How can I concatenate a row vertically every 5 cells?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all,
if A is an array 1 x 100, how can I turn it into an array of 10x10 or 20 x 5?
Thanks
採用された回答
ANKUR KUMAR
2021 年 3 月 12 日
編集済み: ANKUR KUMAR
2021 年 3 月 12 日
You can use reshape command to do that.
A=randi(20,1,100);
reshape(A,20,5);
reshape(A,20,5);
It reshapes along the column of the matrix. This below example clarifies your concept:
A = 1:10;
B = reshape(A,[5,2])
B =
1 6
2 7
3 8
4 9
5 10
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!