<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Oups,<br><br>You are right, it is better computing S'*x0 once.<br><br>Serge<br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;"><b>De: </b>"Adrien Vogt-Schilb" <vogt@centre-cired.fr><br><b>À: </b>users@lists.scilab.org<br><b>Envoyé: </b>Lundi 3 Octobre 2011 18:15:11<br><b>Objet: </b>Re: [scilab-Users] vectorization<br><br>
  
    
  
  
    On 03/10/2011 18:08, Serge Steer wrote:
    <blockquote cite="mid:4E89DE03.2010608@inria.fr"><br>
      R=rand(5,5);R=R+R';//creates a symmetric matrix
      <br>
      [S,K]=schur(R) //R=S*K*S';
      <br>
      K=diag(K);
      <br>
      E=exp(K*t)
      <br>
      x=zeros(size(x0,'*'), size(t,'*'))
      <br>
      for i=1:size(t,'*')
      <br>
        x(:,i)=S*diag(E(:,i)*S'*x0
      <br>
      end
      <br>
      Here you can also use the ode solver to do the job
    </blockquote>
    <br>
    Serge, <br>
    <br>
    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' ?<br>
    <br>
    if not, when t is very large, one should calculate S' once before
    the loop, don't you think?<br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      Adrien Vogt-Schilb (Cired) <br>
      Tel: (+33) 1 43 94 <b>73 77</b></div>
  

</blockquote><br></div></body></html>