I need to locate and pull out a value between 2 numbers within a random matrix. For example, [88 65 98 34 100] I'd want to pull out all numbers between 95 and 100 which would be 98 and 100.

 Akzeptierte Antwort

David Hill
David Hill am 8 Sep. 2022

0 Stimmen

m=[88 65 98 34 100];
m(m>=95&m<=100)
ans = 1×2
98 100

Weitere Antworten (0)

Kategorien

Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2022a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by