Elimination of rows in array

4 vues (au cours des 30 derniers jours)
Vadim Tambovtsev
Vadim Tambovtsev le 7 Oct 2016
Hello. Didn't find a relevant answer.
Suppose we have an array of such form:
A=[a1 b1 c1 d1; a2 b2 c2 d2; etc], i.e. rows of sets of parameters. How to delete from the array the rows with the following conditions:
if 1)a1+b1<c1 then delete that row
and 2) if a1+b1>d1 then delete that row
end
Thank you!

Réponse acceptée

Thorsten
Thorsten le 7 Oct 2016
A(A(:,1)+A(:,2) < A(:,3) | A(:,1)+A(:,2) > A(:,4), :) = [];
  1 commentaire
Vadim Tambovtsev
Vadim Tambovtsev le 7 Oct 2016
Finally, they got deleted, thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by