필터 지우기
필터 지우기

How to index this structure

조회 수: 1 (최근 30일)
Mohannad Abboushi
Mohannad Abboushi 2017년 2월 7일
편집: Adam 2017년 2월 7일
So I have a structure with lots of fields and corresponding values. So for instance if I want to find the indexes for a range of 100-150 how would I do this? The find function doesn't seem to work for a vector: Select_struct=find([file.Position]==100:150)

채택된 답변

Adam
Adam 2017년 2월 7일
편집: Adam 2017년 2월 7일
[~,matchingIdx] = ismember( [file.Position], 100:150 );
or
[~,matchingIdx] = ismember( 100:150, [file.Position] );
depending which way round you want the indices.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by