I'm trying to create a cell array of size N, where every cell is a randomized Matrix of size M, I've tried using deal or simple assignments, but the end result is always N identical Matrices of size M for example:
N=20;
M=10;
CellArray=cell(1,N);
CellArray(1:20)={rand(M)};
this yields identical matrices in each cell, iv'e tried writing the assignment like so:
CellArray{1:20}={rand(M)};
but this yields the following error:
The right hand side of this assignment has too few values to satisfy the left hand side.
the ends results should be a set of transition probability matrices to be used for a model i'm constructing, there's a currently working version of the model, but it uses loops to create the matrices, and works rather slowly, i'd be thankful for any help