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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|improve this question
this sounds like a question you might be better off asking on – Rudy the Reindeer 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
Voted to close. Link to stackoverflow version:… – Jonas Meyer Jun 1 '11 at 3:55
up vote 2 down vote accepted

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

share|cite|improve this answer

I think you can use cell array

a=cell(20);    %Construct cell array
share|cite|improve this answer

Your Answer


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.