Variables become undefined although they are saved in Workspace

1 view (last 30 days)
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 Comments

Sign in to comment.

Accepted Answer

Ilham Hardy
Ilham Hardy on 13 Jan 2016
Did you also define the workspace location?
e.g.
assignin('base','your_variable_name',your_variable_value);
  4 Comments
Adam
Adam on 13 Jan 2016
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by