assigning indices to matrices

Alain Baeckeroot alain.baeckeroot at laposte.net
Mon Jul 20 10:56:58 CDT 2009


Le 19/07/2009 à 19:08, shruti sharma a écrit :
> 
> Dear all,
>       I want to assign an index (say n) to the matrix carrying
> the same "n" as variable. For this I have written program as a
> seperate function file, which I call as "U(n)".
>        My problem is that I want to run a loop over "n" say from 
>1 to 10 and multiply the matrices U(1) * U(2)......* U(n). But not
> able to run the loop. Please suggest me the wayout.
>       Thanks in advance
> 

you can add one dimension to you matrice, corresponding to your indice
U1(k,l) -> V(1,k,l)
U2(k,l) -> V(2,k,l) 
....

i m not sure if the additional dimension should be put before or after
the other indices, for efficiency. V(1,k,l) or V(k,l,1) ?

my 2 cents
Alain





More information about the Help-octave mailing list