help-octave
[Top][All Lists]
Advanced

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

Re: Vectorisation


From: Jaroslav Hajek
Subject: Re: Vectorisation
Date: Fri, 23 Jul 2010 07:16:04 +0200

On Thu, Jul 22, 2010 at 10:56 PM, gastonjulia
<address@hidden> wrote:
>
> Hello again,
>
> thanks for prior help!
> The statement to get the count previously was:
> count = accumarray(data(:,2)+1,1), with and without [1, 20] argument for
> `sz'.
> That worked very well for me. The problem is little extended now: I only
> want to count (+1) if there is a specific number in a new 6th column of my,
> now, 2e6x6 matrix. I could not quite figure out where I can put conditions
> such as `if(data(:,6)==14)', if there is a chance of doing that at all.
>
> Any help appreciated. Best regards,
> Gaston

Do you mean

count = accumarray(data(data(:,6) == 14,2)+1,1)

?

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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