Removing all elements from a struct field
Mostrar comentarios más antiguos
I have a struct
>> aap.acq_details.sessions
ans =
1×13 struct array with fields:
name
I want to simply make this "name" field empty, ie. remove/reset all elements in this specific field.
2 comentarios
Tamer Gezici
el 14 de Jun. de 2022
Editada: Tamer Gezici
el 14 de Jun. de 2022
"So I need it completely deleted, blank. It should not even have empty array in it."
MATLAB does not have a "blank". The default for unallocated cells and fields is an empty array.
C{2} = pi;
C{1}
S(2).F = pi;
S(1).F
Respuesta aceptada
Más respuestas (1)
Matt J
el 14 de Jun. de 2022
[aap.acq_details.sessions.name]=deal([])
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!