help with matrix and how to extract rows
Show older comments
Hi, would like to manipulate this matrix to get 6x6 matrices.
i like to make the first 6 rows to be the new first row, then 7 to 12 to be the second row and then 13to 19 to be the third row and so one. how can i manipulate the, it should look like this :


Accepted Answer
More Answers (2)
madhan ravi
on 30 Sep 2020
Wanted = mat2cell(matrix, repelem(6, numel(matrix)/36)) % not tested
celldisp(Wanted)
Image Analyst
on 30 Sep 2020
Edited: Image Analyst
on 30 Sep 2020
Here's one way (tested on made up "data"):
data = randi(99, 12, 6)
[rows, columns] = size(data)
newRows = rows / 6 % This better be an integer!!!
d = data'
Radiatondamping = reshape(d(:), [], newRows)'
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!