selection of particular rows from a matrix?
1 回表示 (過去 30 日間)
古いコメントを表示
I would like to select rows from a matrix in a particular pattern as: row nos 1,2,3,5,6,7,9,10,11,13 and so on. Please help me in coding the loop.
0 件のコメント
回答 (1 件)
michio
2016 年 10 月 23 日
編集済み: michio
2016 年 10 月 23 日
ismember function could do the work with 'rows' option.
Please check the example code with 'rows' option on the doc page.
1 件のコメント
michio
2016 年 10 月 24 日
Very simple sample code follows.
A = [1,2,3; 2,3,1; 3,1,2];
B = [2,3,1];
idx = ismember(A,B,'rows')
A(idx,:)
参考
カテゴリ
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!