Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I need to build up the matrix of matrices. Say, for all $1\leq i,j\leq n$ I have to define a matrix $p_{ij}$ which will be a matrix $n\times n$. What I can do - it is to build up a matrix $P$ which is $n^2\times n^2$ - but for $n=20$ there is an error about memory.

Could you please tell me how to solve this problem?

share|improve this question
1  
this sounds like a question you might be better off asking on stackoverflow.com –  Matt N. Mar 9 '11 at 9:35
    
thanks, I've done it, they helped. –  Ilya Mar 9 '11 at 12:53
    
Write it as an answer, please. I will accept it. –  Ilya May 31 '11 at 9:53
1  
Voted to close. Link to stackoverflow version: stackoverflow.com/questions/5243507/… –  Jonas Meyer Jun 1 '11 at 3:55

2 Answers 2

up vote 2 down vote accepted

This sounds like a question you might be better off asking on stackoverflow.com.

share|improve this answer

I think you can use cell array

b=rand(20,20);  
c=rand(20,20);
a=cell(20);    %Construct cell array
a{1,1}=b;
a{1,2}=c;
...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.