[scilab-Users] vectorization

Adrien Vogt-Schilb vogt at centre-cired.fr
Mon Oct 3 18:15:11 CEST 2011


On 03/10/2011 18:08, Serge Steer wrote:
>
> R=rand(5,5);R=R+R';//creates a symmetric matrix
> [S,K]=schur(R) //R=S*K*S';
> K=diag(K);
> E=exp(K*t)
> x=zeros(size(x0,'*'), size(t,'*'))
> for i=1:size(t,'*')
>   x(:,i)=S*diag(E(:,i)*S'*x0
> end
> Here you can also use the ode solver to do the job 

Serge,

do you know if x(:,i)=S*diag(E(:,i)*S'*x0  has to compute S' each time? 
or the parser is smart enough to compute S'*x0 without computing S' ?

if not, when t is very large, one should calculate S' once before the 
loop, don't you think?


-- 
Adrien Vogt-Schilb (Cired)
Tel: (+33) 1 43 94 *73 77*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20111003/1bf03a76/attachment.htm>


More information about the users mailing list