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:19:11 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111110 Thunderbird/8.0

On 12/20/2011 06:10 PM, Olaf Till wrote:
> On Tue, Dec 20, 2011 at 05:53:10PM +0800, address@hidden wrote:
>> 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?
> 
> B = A * diag (c);
> 

Thanks!
ST
--


reply via email to

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