How to reopen a same figure with different buttons in Matlab App designer

3 ビュー (過去 30 日間)
RITAM BASU
RITAM BASU 2022 年 8 月 21 日
回答済み: Walter Roberson 2022 年 8 月 22 日
Hello,
In the app I am working on, I am trying to achieve the following functionality -
As can be seen in the picture, there are 4 buttons. button 1 (PLOT) plots 2 graphs in UIAxes(in the app). Button 2&3 (open in new Window) open the graphs individually in new figure windows and button 4(EXPORT) saves this plots to a desired folder.
Currently, I am plotting in UIAxes, then I am plotting a new graph in a new window, then I am plotting a new graph in new window to export it.
But it is not a nice solution.
So, is there any way I can store the figure (maybe as a property) in the app and can recall when different buttons (2,3,4) were pressed?
I am trying to get the figure or its handles (as an output) from the function I run when button 1 is pushed, and then store it as a property in the app, then call this figure when button 2,3,4 are pushed. I am getting the handle, but not being able to reconstruct the figure after that.
Have a nice day.

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 22 日
You can store handles to figures as "properties" of your app, or you can store them as UserData properties of any of a number of kinds of objects.
However the handles would have to be to figures that currently exist. You might possibly switch the figure between visible and not.
Otherwise you would have to use the callbacks to openfig()... though at the moment I am not sure what the support is for openfig and app designer

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by