Passing Data between two Apps

17 次查看(过去 30 天)
I have created two apps (App1, and statitics), and I would like to pass the following data from the first one into the second one when the user click of a button.
The call back function to call the second app looks like this:
I don't know how should I fix the code, so that when I click on the statistics button I get the second app loaded with the needed data.
I've already read the follwoing page, but I didn't understand how to fix it:
Thus I would appreciate any valuable input!

采纳的回答

Cris LaPierre
Cris LaPierre 2022-5-5
  5 个评论
Cris LaPierre
Cris LaPierre 2022-5-10
It looks like you are not following the instructions I linked to. Perhaps open the example files and inspect the two apps. You can do so by running this command:
openExample('matlab/AppsThatShareDataExample','supportingFile','DialogAppExample');appdesigner('MainAppExample');
Hidd_1
Hidd_1 2022-5-10
编辑:Hidd_1 2022-5-10
here are the changes I've made:
I added the following in the 1st app
methods (Access = public)
function Import(app, sz, c)
% Store inputs as properties
app.info_1 = sz;
app.data_1 = c;
end
end
I added "Statistics" in the propereties in the 1st app (with data_1 and info_1).
Here is the pushback function for Statistics:
function StatisticsButtonPushed(app, event)
app.DialogApp = Statistics(app, app.info_1, app.data_1);
end
In the 2ed App I added "CallingApp" to the properties, and here is the pushback function for the import button:
function ImportButtonPushed(app, event)
Import(app.CallingApp);
end
am I doing progress? and What's still missing?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by