How can I convert an array to a matrix?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have an array as follow:
A = [127 77 107 148 30];
I want to convert this array as follows:
B = [127 0;77 0;107 0;148 30]
I mean, I want to split A array unequally or equally.
How can I do this?
Thanks.
4 件のコメント
Image Analyst
2023 年 4 月 5 日
編集済み: Image Analyst
2023 年 4 月 5 日
Are you going to specify the number of columns to put into each row, like
columnsPerRow = [1; 6];
or
columnsPerRow = [1; 4; 2];
??? Otherwise how would we know? Is this your homework? Sounds like it.
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!