help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiply some colums, discarding others


From: David Bateman
Subject: Re: Multiply some colums, discarding others
Date: Tue, 24 Nov 2009 20:40:55 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Renato S. Yamane wrote:
Hi,

I have a doubt about how can I use Octave :-)

E.g.:

Matrix A is "freq", "impedance" and "phase", like this:

A =
        20.66      12.32      49.63
        21.47      13.75      48.86
        22.30      15.92      47.71
        23.17      18.43      45.06
        24.07      22.61      39.76

I would like to get another Matrix, B, with the result of multiplication of "impedance" and "phase", like this:

        A(1,2) * cos(A(1,3))
        A(2,2) * cos(A(2,3))
        A(3,2) * cos(A(3,3))
        A(4,2) * cos(A(4,3))
        A(5,2) * cos(A(5,3))


A(:,2).*cos(A(:,3))

As you can see, the collum "frequency" is not used.

The problem is: Matrix "A" have a lot ofA lines and I need avoid type one by one, so I would like to know if is possible multiply *automatically* to get "frequency" and multiplication of impedance and phase, like this:

Matrix "B" =

        20.66      A(1,2) * cos(A(1,3))
        21.47      A(2,2) * cos(A(2,3))
        22.30      A(3,2) * cos(A(3,3))
        23.17      A(4,2) * cos(A(4,3))
        24.07      A(5,2) * cos(A(5,3))
[A(:,1),A(:,2).*cos(A(:,3))]


Regards,
Renato S. Yamane
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave





reply via email to

[Prev in Thread] Current Thread [Next in Thread]