Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

GUI with guide, statements around the functions

1 visualización (últimos 30 días)
Emma Sandström
Emma Sandström el 5 de Mayo de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello, Im building a pretty large GUI with guide and im stuck behind that i cannot use statements around the accual callback functions. Is this something that can be done at all?
I saw something about creating an own function and re-lable the functions for the Components in the GUI. it is possible to make the entire GUI behind a functions with multiple functions behind it?
Another question is how i can use the variables from the workspace back to my GUI again, im sending some to the WS to be able to use them in a diffrent background script, and then send them back to a plot inside the GUI.
Thanks
  1 comentario
Adam
Adam el 5 de Mayo de 2017
Editada: Adam el 5 de Mayo de 2017
What do you mean by 'statements around the actual callback functions'?
Callbacks are, by their nature, triggered by the UI components for which they are callbacks. That is their sole purpose.
As far as workspace goes, use the GUI's own workspace(s). Each callback has its own workspace and can call functions just like you can from the base workspace or a script. It doesn't make any sense to have variables dumped to the base workspace from a GUI normally because if the person using the GUI has access to the workspace they might as well just create the variables there directly without bothering with the GUI!

Respuestas (1)

Santhana Raj
Santhana Raj el 5 de Mayo de 2017
U can use statements 'around' callback functions. You have to be more clear on this.
Since you are new to GUIDE, I would advise you not to do that. But instead call these self created functions from the callback functions
Instead of taking data to WS and then back in, Use the structure "handles." This is passed on to all functions and if used properly, work like a charm.

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by