How do I find the first value (in a vector) larger than a cutoff value without using for/while loops?

19 views (last 30 days)
For example: v=[0.2, 0.8, 0.9, 1.15, 8.2, 9.3, 7.6, 6.5, 5.2, 3.4]; cutoff=7; The answer should be 8.2.

Accepted Answer

Thorsten
Thorsten on 30 Jun 2015
v(find(v > cutoff, 1))

More Answers (0)

Categories

Find more on Loops and Conditional Statements 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!