Pass variable from one callback to another

Hey guys, I wanted to know how to pass the value of a variable from one callback function to another withing the same GUI. Thanks.

3 comentarios

Vivek
Vivek el 18 de En. de 2014
Editada: Vivek el 18 de En. de 2014
Using assignin command assign that to base workspace and fetch the same using evalin at another callback.
Else use nested function ex: func1(func2(x))
Jan
Jan el 18 de En. de 2014
@Vivek: No, don't do this. Poluting the base workspace is a really bad idea.
Alexei
Alexei el 14 de Nov. de 2014
Why, what's wrong with putting a variable in the workspace? Why is that "polluting"?

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 18 de En. de 2014
Editada: Jan el 18 de En. de 2014

0 votos

This topic has been discussed very frequently, such that searching will be useful:
You will find many suggestions concerning the commands setappdata and guidata, which both store the variables locally in the GUI.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de En. de 2014

Comentada:

el 14 de Nov. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by