help-octave
[Top][All Lists]
Advanced

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

Re: assigning indices to matrices


From: James Sherman Jr.
Subject: Re: assigning indices to matrices
Date: Mon, 20 Jul 2009 11:52:12 -0400

I'm not quite sure what you're trying to do here.  Is U a function that takes an integer as an input and returns a matrix?  I don't know if this is what you want to do, but if you have a collection of matrices of the same size, I'd store them in a 3 dimensional matrix like so:

U(:, :, 1) = first_matrix;
U(:, :, 2) = second_matrix;

and so on, then to access them, you just need to do:

fifth_matrix = squeeze(U(:, :, 5));

though depending on what you need to do, squeeze might not be necessary.

Hope this helps.


On Sun, Jul 19, 2009 at 1:08 PM, shruti sharma <address@hidden> wrote:

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

Sincerely,
Shruti


     See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/


_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

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