I have a text file that is a matrix 2819x10. I have splited it into 5x5x563 matrix using code below
Matrix = dlmread('det.txt');
for j=1:1:563
for i=1:1:5
M(i,1,j) = Matrix(temp,3);
M(i,2,j)= Matrix(temp,4);
M(i,3,j)= Matrix(temp,5);
M(i,4,j) = Matrix(temp,6);
M(i,5,j) = 1;
temp=temp+1;
end
end
After this code I have Matrix 5x5x563. Right now I would like to to create a array like is presented bellow, that consist only one row, and each column is my matrix of 5x5.
I have tried with mat2cell:
MatrixNew= mat2cell(M, 5, 5);
But I have still an error. I dont have clue how to fix it. I am not try to find a ready code but just advice.
How can I accomplish this?