How can I select scattered rows from an array? Suppose
A = rand(6,6)
now how can I select everything except the second and fifth row of A?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 26 日

0 投票

You can use setdiff()
A = rand(6,6);
idx = setdiff(1:size(A,1), [2 5]);
B = A(idx, :);

その他の回答 (0 件)

カテゴリ

質問済み:

2020 年 4 月 26 日

回答済み:

2020 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by