How can I remove rows from a matrix with a for statement and if statement?
1 view (last 30 days)
Show older comments
Wesley Brown
on 31 Mar 2019
Commented: Wesley Brown
on 31 Mar 2019
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?
0 Comments
Accepted Answer
madhan ravi
on 31 Mar 2019
No loop, if and elseif needed:
A((A(:,1)>maxvalue)|(A(:,1)<minvalue),:)=[]
More Answers (1)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!