How to remove rows that meet a condition?

1 回表示 (過去 30 日間)
Louisa Thomas
Louisa Thomas 2017 年 10 月 19 日
回答済み: KL 2017 年 10 月 19 日
a = [1:19];
b = [2:20];
c = [1, 7, 14, 28, 42, 60, 90];
allOptions = combvec(a,b,c);
allOptions = allOptions';
This piece of script comes up with a new variable (2527 x 3).
How do I remove every row in which the value in column 1 is equal to or larger than the value in column 2?

採用された回答

KL
KL 2017 年 10 月 19 日
allOptions(allOptions(:,1)>=allOptions(:,2),:)=[];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecial Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by