Variables become undefined although they are saved in Workspace

1 visualización (últimos 30 días)
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 comentarios
Adam
Adam el 13 de En. de 2016
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.

Iniciar sesión para comentar.

Respuesta aceptada

Ilham Hardy
Ilham Hardy el 13 de En. de 2016
Did you also define the workspace location?
e.g.
assignin('base','your_variable_name',your_variable_value);
  4 comentarios
Mus'ab Ahmad
Mus'ab Ahmad el 13 de En. de 2016
Editada: Mus'ab Ahmad el 13 de En. de 2016
Yes this what I meant; using it in another callback. It works now, thanks a lot.
Adam
Adam el 13 de En. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Software Development Tools en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by