Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Question with accessing field in a structure

1 visualización (últimos 30 días)
Daniel Campbell
Daniel Campbell el 22 de Oct. de 2015
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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.

Respuestas (1)

dpb
dpb el 23 de Oct. de 2015
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...

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by