フィルターのクリア

GUI Handles?

2 ビュー (過去 30 日間)
Benjamin
Benjamin 2011 年 7 月 19 日
I am trying to make a multi windowed GUI I am using the function setappdata(...) to pass information between the two GUI. I do not want to use the root ('0') to store the data because I dont know what will happen if I want to create an executable of the GUI. When I use the handle of the main window called POWERMODEL to get the data in the subgui it plots the data I am trying to plot in the main gui window
PV = getappdata(0, 'PV'); plot(PV.signals.values(:,1),PV.signals.values(:,2)) axis([0 0.6 0 0.5])
I can think of two workaround 1) figure out how to reset the default handle to the subgui 2) tell plot to plot to the proper place
Can someone tell me how to do it either way
  2 件のコメント
Jan
Jan 2011 年 7 月 19 日
I do not understand the question. You do not want to use the Root handle, but you do it in the example. Is the shown line called in a callback of the main GUI or from the callback of the sub-GUI? Is the problem only to specify the figure to create a new axes in? Or do you search for an efficient way to store PV, such that the different figures can get them easily?
Benjamin
Benjamin 2011 年 7 月 19 日
The line is in the Sub GUI
When I used the maingui to store the data the place the plot was going changed and it was going to the main gui instead of the main window.

サインインしてコメントする。

採用された回答

Daniel Shub
Daniel Shub 2011 年 7 月 19 日
Your two work arounds are right on. When you create the axis you want to plot into (possibly with subplot), it will return a handle ...
hax = subplot(2,2,1);
You need to save this handle (hax) into the app data. Then you can either call (your solution 1)
axes(hax)
plot(x, y)
or (your solution 2)
plot(hax, x, y)

その他の回答 (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