help-octave
[Top][All Lists]
Advanced

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

Re: Vectorisation


From: gastonjulia
Subject: Re: Vectorisation
Date: Fri, 23 Jul 2010 01:04:54 -0700 (PDT)

Thanks Jaroslav,

but I don't think that this is what I want to do. Let try to explain my
problem with a piece of linear code.

1>data = load('results.vec'); % Btw, is there way to increase speed here?
2>for i = 1:length(data) % length(data) is appr. 2e6
3>    if (data(i,6) == 14)
4>        count(data(i,2)+1)++;
5>    endif
6>endfor

The problem with the for loop is solved by `count =
accumarray(data(:,2)+1,1)', I can see that, but I don't see where to fit in
the condition.

Best regards,
Gaston
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Vectorisation-tp2281066p2299815.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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