How to select rows from an array?
178 ビュー (過去 30 日間)
古いコメントを表示
I have matrix of A . I need to select the 2nd, 4th and 6th row. How can I write that in MATLAB code?
0 件のコメント
回答 (3 件)
Torsten
2022 年 10 月 12 日
B = [A(2,:);A(4,:);A(6,:)]
or if you want the rows one by one:
A2 = A(2,:);
A4 = A(4,:);
A6 = A(6,:);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!