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: macy
Subject: Re: Multiply some colums, discarding others
Date: Tue, 24 Nov 2009 11:50:37 -0800 (PST)
User-agent: SquirrelMail/1.4.13

you might try:

>> B = [ A(:,1), A(:,2).*cos(A(:,3)) ];


> 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))
>
> As you can see, the collum "frequency" is not used.
>
> The problem is: Matrix "A" have a lot of 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))
>
> Regards,
> Renato S. Yamane




reply via email to

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