Hi,
I am working on my project on matlab where I have to divide an array of size 1X711000 in to subarrays of size of 1X100.
Can I use the command mat2cell command for it?
Please give the proper command for it.
1
Expert's answer
2012-01-12T10:09:57-0500
Suppose your array is called A and has size 1 x N*M, so it is a row. To divide it into N cell arrays of length M use the command: C = mat2cell(A,[1],ones(1,N)*M);
Now to access the i-th M-tuple you should run C{i}
In your case you should run C = mat2cell(A,[1],ones(1,7110)*100); ===============================
Another approach is to convert A into M x N array (M rows and N columns) by the command D = reshape(A,M,N) Then to access the i-th M-tuple run D(:,i) In your case use the command D = reshape(A,100,7110)
The expert did excellent work as usual and was extremely helpful for me.
"Assignmentexpert.com" has experienced experts and professional in the market. Thanks.
Comments