Info

この質問は閉じられています。 編集または回答するには再度開いてください。

GUI with guide, statements around the functions

1 回表示 (過去 30 日間)
Emma Sandström
Emma Sandström 2017 年 5 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Adam
Adam 2017 年 5 月 5 日
編集済み: Adam 2017 年 5 月 5 日
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!

回答 (1 件)

Santhana Raj
Santhana Raj 2017 年 5 月 5 日
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.

Community Treasure Hunt

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

Start Hunting!

Translated by