I have a 256x4 matrix. I want to divide the matrix into 256 matrices of 4 elements each. I am having a lot of difficulties. I tried using the mat2cell fn but it does not accept variable values. I would have to write '1' 256 times. Any suggestions?

1 次查看(过去 30 天)
Help would be really appreciated. I want all the rows as separate matrices. See, I have a 256x4 matrix which I eventually plan to increase in size. After this matrix generation am planning to operate upon all the rows separately. I actually want to re-shape these division of rows into matrices again and then work on them separately. Any help would be highly appreciated.

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-6-1
M=rand(256,4)
out=mat2cell(M,4*ones(64,1),4)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by