find index of value in array
Afficher commentaires plus anciens
hello, how can I find which numbers in a matrix are less than x and then print another number instead of the number I found?
Réponses (1)
A = randi(99,10,10) % test array
x = 30;
lessthanx = A(A<x) % all the numbers in A that are < x
fprintf('%d',randi(1000,1,1)) % "print another number instead of the number I found"
Catégories
En savoir plus sur Data Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!