Elimination of rows in array

조회 수: 4 (최근 30일)
Vadim Tambovtsev
Vadim Tambovtsev 2016년 10월 7일
댓글: Vadim Tambovtsev 2016년 10월 7일
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!

채택된 답변

Thorsten
Thorsten 2016년 10월 7일
A(A(:,1)+A(:,2) < A(:,3) | A(:,1)+A(:,2) > A(:,4), :) = [];
  댓글 수: 1
Vadim Tambovtsev
Vadim Tambovtsev 2016년 10월 7일
Finally, they got deleted, thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by