To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
Hi everybody, First of all , I would like to thank in advance the help.
I have a problem, the first one it is that I am bennigner in matlab and I do not know probably If my explanation is good.
I have the following file:
I know how to open, and manage with it. what I would like to know is as you see, there are 4 columms, each columm has 3 groups of values from min to max I want to make some loop to crop the matrix and divide in 3 diferent matrix that have only one group from min to max, for example,
1 1 2 2 3 3 1 1 2 2 3 3 1 1 2 2 3 3
and obtain 3 diferent matrix like below:
1 1 2 2 3 3
the purpose of using a loop is because the file size changes in rows and columns.
Any help is deeply valuable for me.
No products are associated with this question.
m = dlmread('pathtovalidx.txt'); idx = cumsum([true;diff(m(:,1)) < 0]); a = unique(histc(idx,1:idx(end))); if numel(a) == 1 out = reshape(m,a,size(m,2),); else out = mat2cell(m,a,size(m,2)); end
here out is three dimension double array or cell array, where each page or cell with your new matrix