Variables become undefined although they are saved in Workspace
1 次查看(过去 30 天)
显示 更早的评论
I read XML file using GUI pushbutton, extract some data, and do some manipulations for them. The thing is although I save the required variables to workspace (using assignin), I can't use them outside the pushbutton callback function for further manipulation because matlab tells me 'undefined variables'! any suggestions? Thanks
6 个评论
Adam
2016-1-13
You need to make sure you click 'Attach File' after clicking the paper clip and choosing your file. A lot of people (including myself sometimes) miss that and think it is attached just through choosing the file under the paperclip.
采纳的回答
Ilham Hardy
2016-1-13
Did you also define the workspace location?
e.g.
assignin('base','your_variable_name',your_variable_value);
4 个评论
Adam
2016-1-13
If you just want to share data between callbacks then you shouldn't go through the base workspace at all, but I guess it works for you for now.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Software Development Tools 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!