フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Question with accessing field in a structure

1 回表示 (過去 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