help-octave
[Top][All Lists]
Advanced

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

Re: A vectorization question


From: lukshuntim
Subject: Re: A vectorization question
Date: Tue, 20 Dec 2011 18:16:34 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111110 Thunderbird/8.0

On 12/20/2011 06:07 PM, marco atzeri wrote:
> On 12/20/2011 10:53 AM,  wrote:
>> Hi,
>>
>> Is there a way of getting rid of this loop in
>>
>> for j=1:n
>>      B(:,j)=c(j) * A(:,j);
>> endfor
>>
>> where c is a n-vector and A is a m by n matrix?
>>
>> Regards,
>> ST
> 
> Am I missing something or it is just a standard matrix multiplication ?
> 
> B=A*c
> 
> or use c' depending if its size is nx1 or 1xn
> 
> Marco

Hi Marco,

No, B is also a m by n matrix, the j-th column being c(j)*A(:,j).

Regards,
ST
-- 


> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
> 



reply via email to

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