How to pass data from Dialog App to Calling App before closing Dialog App?
2 ビュー (過去 30 日間)
古いコメントを表示
I have an app that opens a Dialog app when pushing a button. In the Dialog app I want to insert some data, that then gets passed on to the main app before closing the Dialog app. How can I do that?
Below my code with the missing lines where I would like to pass the data from the Dialog App to the main app:

properties (Access = private)
CallingApp % Description
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app, mainapp, dby, compass)
app.CallingApp=mainapp;
end
% Button pushed function: OKButton
function OKButtonPushed(app, event)
% pass on data from this app to CallingApp
????
% delete dialog window
delete(app)
end
% Value changed function: speedupdownsampledatabySpinner
function speedupdownsampledatabySpinnerValueChanged(app, event)
dby = app.speedupdownsampledatabySpinner.Value;
end
% Value changed function: toolorientationSpinner
function toolorientationSpinnerValueChanged(app, event)
compass = app.toolorientationSpinner.Value;
end
end
Thank you!
回答 (1 件)
Thomas Fournier
2021 年 9 月 10 日
So you have a Dialog app and a calling app, imagine in your calling app you have a property called speed,
in your calling app you access it with app.speed, but if you want to change it from your Dialog app you have to write
app.CallingApp.speed='something'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Downloads についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!