フィルターのクリア

Share data between functions in main

1 回表示 (過去 30 日間)
Nu9
Nu9 2011 年 8 月 30 日
hi,i've a project that open a sub-gui to input some values and it sendds to main-gui. in main gui i need to use those values in a function that plot the result of simulation. i'm not using guide.the code:
function [] = gui_passdata()
S.fh = figure('units','pixels',...
'position',[20 104 851 596],...
'numbertitle','off',...
'name','Simulação',...
'resize','on');
S.ed = uicontrol('style','text',...
'units','pix',...
'position',[50 414 101 31],...
'string','Temperatura.');
S.pb2 = uicontrol('style','pushbutton',...
'units','pix',...
'position',[549 30 151 31],...
'string','Executar',...
'callback',{@pb2_call,S});
guidata(S.fh,S);
uicontrol(S.ed)
function [] = pb2_call(varargin)
% Callback for GUI_24 pushbutton.
S = guidata(gcbf); % Get the structure.
i want to pass data from gui_passdata to pb2_call but i only find how to share data with GUI

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 8 月 30 日
Well, since you are not using GUI, I think it's easier. You can define the output argument of your function gui_passdata() and pb2_call().
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 8 月 30 日
All I am saying is that you are not bounded by the GUI template. You can return any data in any format you like in your function. Maybe give it a good thought first and plan a good data structure.
Nu9
Nu9 2011 年 8 月 30 日
ok your're right, but i've doubts about the return data from a structure. i can define in pb2_call this:
temp=s.ed
,after i get the structure?

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

カテゴリ

Help Center および File ExchangePredictive Maintenance Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by