Info
この質問は閉じられています。 編集または回答するには再度開いてください。
passing data from Gui 1 to Gui 2
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone, I have an equation in Gui 2 that contains some inputs.
some of the inputs are entered in Gui 1.
what should I do???
please specify exact code and the right place of that and etc.
because I'm trying to figure out for 5 days and I'm gonna be crazy.
beside I read some answers related to my question and unfortunately doesn't work for me.
THANK YOU GUYS.
2 件のコメント
Adam
2015 年 12 月 4 日
編集済み: Adam
2015 年 12 月 4 日
I use classes to achieve this in what seems to me to be the neatest manner, but if you are not familiar with OOP programming in Matlab and don't want to or have time to learn it then that is an advanced solution. If you create a handle-derived class and pass it from GUI1 to GUI2 then you can access this object in both UIs. The first can set its properties from the inputs of GUI1 and in GUI2 you can add listeners to know when these parameters change.
http://uk.mathworks.com/help/matlab/object-oriented-programming.html http://www.mathworks.co.uk/help/pdf_doc/matlab/matlab_oop.pdf
Other solutions tend to involve using
doc findobj
doc getappdata
doc setappdata
to locate the handle of the second figure and access it's data that way.
I would never recommend this approach and have never used it personally, but I don't have the time to give full code for you using my recommended approach.
回答 (1 件)
Image Analyst
2015 年 12 月 3 日
See the bottom part of this section of the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
Honestly it might be easier if you just combined them into one GUI.
3 件のコメント
Image Analyst
2015 年 12 月 3 日
What doesn't work? In the FAQ it talks about using assignin() and Geoff Hayes solution in an Answers posting. Which did you use? Share your code for it.
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!