Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Question with accessing field in a structure

조회 수: 2 (최근 30일)
Daniel Campbell
Daniel Campbell 2015년 10월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
I'm new to MatLab so bear with me:
I have a structure named Recordings that has a field named Task, which can be either 'A', 'P', or some other value.
I want to create an index that tells me whether or not Recordings(x).Task is equal to A.
How would I go about this?
Thanks in advance.

답변 (1개)

dpb
dpb 2015년 10월 23일
isA=ismember([Recordings.Task].','A');
[] returns comma-separated list as array, .' transforms it to column vector...
Mayhaps there's a more direct way but I'm not all that adept w/ structures meself, yet...

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by