help-octave
[Top][All Lists]
Advanced

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

help with vectorization of update rule


From: grg
Subject: help with vectorization of update rule
Date: Thu, 21 Oct 2010 08:29:11 -0700 (PDT)

Sorry, I am reposting this, because I am not sure if it was seen.


 Hi there,

I am working with a system of difference equations that I solve using the
following (pseudo)code:

x=nan(s,t);
for it=1:T
   x(:,it+1)=A*x(:,it);
endfor

where A is a square matrix of dimensions (s,s) and x is a matrix of
dimensions (s,T)

My question: is there a way to avoid the for loop and speed up the
computation?
It would be relatively straightforward to do it, if A was a scalar, rather
than a matrix.

But I have no clue on how to do it when A is a matrix.

Any input will be greatly appreciated.
Thanks in advance.

best regards,
giorgio 
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/help-with-vectorization-of-update-rule-tp3005798p3005798.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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