Finding indices of array that has a constraint

조회 수: 4 (최근 30일)
Rick
Rick 2014년 6월 17일
답변: Zikobrelli 2014년 6월 17일
Hello
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?

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Logical (Boolean) Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by