Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Question with accessing field in a structure
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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...
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!