Finding indices of array that has a constraint

7 views (last 30 days)
Rick on 17 Jun 2014
Answered: Zikobrelli on 17 Jun 2014
I have an array with a set of constraints imposed, and I want to know the single indices of all elements that meet the constraints. How can I go about doing that?

Answers (1)

Zikobrelli on 17 Jun 2014
vector B=[1:10]
Constraint: greater than 5
idx=find(B>5)% will give you the indices satisfying the constraint


Community Treasure Hunt

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

Start Hunting!