How can I remove rows from a matrix with a for statement and if statement?

I want to remove any of the rows from matrix A whose column 1 is either greater than the max value or less than the min value.
I get the following error:
What am I doing wrong here?

 채택된 답변

No loop, if and elseif needed:
A((A(:,1)>maxvalue)|(A(:,1)<minvalue),:)=[]

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2019년 3월 31일

댓글:

2019년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by