[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need help to vectorize code
From: |
PetrSt |
Subject: |
Re: Need help to vectorize code |
Date: |
Mon, 15 Apr 2013 09:35:00 -0700 (PDT) |
1) You can pass Z to lsode as a single row vector, so that lsode would be
called exactly once. The core of vectorization lies then in "Do Something"
statement. However, imagine the returned output (X) would be 1e4 x 1e4
matrix, what is quite a lot. This matrix can be eventyaly rearanged, e.g
X=reshape(X,[1e4,100,100]) and then summed by 1st and 2nd dim.
2) You can use for loop to call lsode, collect outputs to e.g. three-dim
matrix and then make sums as above.
3) According to the sizes of Z and t, I advice you to use it as it is. Let
the for loop work.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Need-help-to-vectorize-code-tp4651810p4651889.html
Sent from the Octave - General mailing list archive at Nabble.com.