Editing structure fields using a MATLAB App
15 次查看(过去 30 天)
显示 更早的评论
Currently I am working on a project that requires an easy and user-friendly access to different variables, for this reason I am developing an app that simply allows to modify variables on the base workspace. The problem appears when structure fields are added, the assignin function prompts an error:
Error using assignin
Invalid variable name "Struct.Variable" in ASSIGNIN.
I would like to implement a method that can automatically evaluate all the variables in the base workspace preferably without using an auxiliary file. Furthermore I would also like to change the default values shown in the app layout whenever the values are changed using the Edit Field.
Thanks in advance
0 个评论
采纳的回答
Walter Roberson
2022-8-11
assignin() can only assign to complete un-indexed variables.
You will need to load the current struct into your workspace, modify the field, and assignin() the entire struct.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!