check values of all elements of an array

5 Ansichten (letzte 30 Tage)
Zeynab Mousavikhamene
Zeynab Mousavikhamene am 6 Sep. 2019
I have array which has multiple elements. I want to find the elements that are larger than 1 and put the value with the index of the element in a new array.
I need to know whether it was elemet 10 or 12 that the value was larger than one and what was the value.
I need to avoid loop as much as possible. What would be the shortest way?

Antworten (1)

madhan ravi
madhan ravi am 6 Sep. 2019
Use find() , logical operators also use ismember() to know the existence of those numbers.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by