I have a 50 X 1 cell array, A, and each cell contains an m x 100 matrix, where m is variable and not the same for each of the cells. I would like to convert this cell array to a 3D matrix, Anew(M,100,50), where M is the first dimension of the matrix with biggest rows, and pad zero for the small matrices. I tried cell2mat but it concatenated the cell into a 2D matrix ([…],100). I also tried:
for ii=1:50Anew(:,:,ii)=A{ii};end
but I got
Subscripted assignment dimension mismatch.
error. Does anyone know how it can be done?
Thanks
This is the first 6 cells of A:
A = [ 44x100 double] [ 80x100 double] [103x100 double] [ 96x100 double] [ 94x100 double] [ 92x100 double] . . .
Best Answer