Selecting records from a matrix subject to a condition

1 view (last 30 days)
My matrix(M) looks like the data below; how can I pull the records that have a third column greater than or equal to 20?
1 0.4 12
2 1.3 20
3 1.2 15
4 2.1 21

Accepted Answer

Walter Roberson
Walter Roberson on 19 Mar 2017
M(M(:,3)>=20, :)

More Answers (0)

Categories

Find more on MATLAB 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!