Assign a 'double' variable to struct
12 次查看(过去 30 天)
显示 更早的评论
I have a variable as such:
A.b = 'example';
And I want to change it to:
A.b.c = 2;
How can I do it without it prompting:
'Field assignment to a non-structure array object'
It worked on matlab's version before 2014.
Thank you,
Ziv
2 个评论
Stephen23
2018-1-10
You can't.
You first define the field b as a double. You cannot then try to access field b as a structure.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axes Appearance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!