I have four 19829×1000 matrices. 1000 is the number of different measurement. I want to assign each column to an array in the following format. According to the following code, I need c{1}{1} to be the value of first variable, A, for the first experiment; that is c{1}{1}=A(:,1) ans so forth. As another example, I want c{3}{456} to be the value of the third variable, C, for the 456th experiment; that is c{3}{456}=C(:,456).
A; % 19829x1000 matrix containing the value of A
B; % 19829x1000 matrix containing the value of B
C; % 19829x1000 matrix containing the value of C
D; % 19829x1000 matrix containing the value of D
c=cell(4, 1000);[c{1,:}]=mat2cell(A);[c{2,:}]=mat2cell(B);[c{3,:}]=mat2cell(C);[c{4,:}]=mat2cell(D);
Unfortunately, it doesn't work. I also tried DEAL function:
[c{1,:}]=deal(mat2cell(A));
but this one doesn't work either.
Please help me.
Best Answer