Tags:


Make a list of matrices in MatLab
March 1, 2007 11:15 AM   RSS feed for this thread Subscribe

How do I implement a Matrix (or list) of matrices in MatLab?

I need to make a list of matrices, the matrices are not all the same size. This seems like it should be really easy, but I can't figure out how to do it.
posted by atrazine to computers & internet (4 comments total)
You need to provide a little more information than this before we can help you. Do you want to add a number of matrices to a larger order matrix?
posted by swordfishtrombones at 11:22 AM on March 1, 2007


Have you considered using a Cell Array?
posted by swordfishtrombones at 11:31 AM on March 1, 2007


I hope I am not doing someone's homework, but here's what I think you want (and I'll shut up now...


>> a = ones(5,5);
>> b = ones(6,6);
>> c{1} = a;
>> c{2} = b;
>> c

c =

[5x5 double] [6x6 double]

>> c{1}

ans =

1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
posted by swordfishtrombones at 11:36 AM on March 1, 2007


oh dear. Of course, a cell array.
swordfishtrombones, no, not homework. I'm moving a whole bunch of matrix manipulation code that was inadvisably written for MAPLE to MatLab, and I'm not really very familiar with the latter.
posted by atrazine at 12:15 PM on March 1, 2007


« Older My fiancee and I are planning ...   |   I live in Berkeley, CA and nee... Newer »
This thread is closed to new comments.