help-octave
[Top][All Lists]
Advanced

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

Re: Yet Another Vectorization Quiz


From: c.
Subject: Re: Yet Another Vectorization Quiz
Date: Wed, 15 Dec 2010 00:07:05 +0100

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.


reply via email to

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