Removing all elements from a struct field
显示 更早的评论
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 个评论
Tamer Gezici
2022-6-14
编辑:Tamer Gezici
2022-6-14
"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
采纳的回答
更多回答(1 个)
Matt J
2022-6-14
[aap.acq_details.sessions.name]=deal([])
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!