How to remove rows that meet a condition?

2 vues (au cours des 30 derniers jours)
Louisa Thomas
Louisa Thomas le 19 Oct 2017
Réponse apportée : KL le 19 Oct 2017
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?

Réponse acceptée

KL
KL le 19 Oct 2017
allOptions(allOptions(:,1)>=allOptions(:,2),:)=[];

Plus de réponses (0)

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by