help-octave
[Top][All Lists]
Advanced

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

Re: Yet Another Vectorization Quiz


From: Ben Abbott
Subject: Re: Yet Another Vectorization Quiz
Date: Tue, 14 Dec 2010 18:12:22 -0500

On Dec 14, 2010, at 6:07 PM, c. wrote:

> Ben,
> 
> On 14 Dec 2010, at 23:39, bpabbott wrote:
> 
>> [~, n] = sort (a==0);
>> a = a (ones (size (a, 1), 1) * (0:size (a, 2) - 1) * 4 + n)
> 
> Thanks! This works great (thoug I'm still trying to fully understand why ;) )
> except for the '[~, n]' syntax, maybe this requires the developement version?
> I need the code to be compatible with 3.2.4 so I', using 
> 
> [ignore, n] = sort (a==0);
> 
> I guess '4' stands for size (a, 1), right?
> 
> Thanks again!
> c.

Yes and Yes.

Ben



reply via email to

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