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: Thu, 8 Jul 2010 04:07:22 -0700 (PDT)

Hi,

thanks for all the suggestions.

`count = accumarray (data(:,3), 1, [1, 20]);' was not quite working, but I
looked up accumarray and found that `count_fast = accumarray
(data(:,3),1:1);' did generate the same vector as for loop solution. I am
still not quite sure about the arguments of accumarray but it does the job
in 1.3 seconds, compared to the for loop which takes 43 seconds.

So thanks very much,
Gaston

p.s.: if it is of any interest, here is the error message of count =
accumarray (data(:,3), 1, [1, 20]);
error: accumarray: inconsistent dimensions
error: evaluating if command near line 67, column 3
error: called from `accumarray' in file
`/usr/share/octave/3.0.5/m/general/accumarray.m'
error: evaluating assignment expression near line 4, column 7
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Vectorisation-tp2281066p2282135.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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