Info

此问题已关闭。 请重新打开它进行编辑或回答。

I have a matrix of dimension a=[993,1], I need a matrix b=[331,3] such that every 3 columns of the a forms a row of b

1 次查看(过去 30 天)
the problem is like a=[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18] and I need b of the following form b=[1 2 3;4 5 6; 7 8 9; 10 11 12; 13 14 15; 16 17 18]

回答(1 个)

Mischa Kim
Mischa Kim 2014-6-3
Chris, use
b = reshape(a',3,[])'

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by