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일

0 개 추천

댓글 수: 5

Hidd_1
Hidd_1 2022년 5월 5일
I've already check them up, but I really don't know how to solve it.
I treid creating a function like the one montioned in the solution, but for some reason I just don't get it!
I wish if someone can offer a guidline of steps that should be taken.
Cris LaPierre
Cris LaPierre 2022년 5월 5일
Between those two links, there are quite a few steps. There are also many other posts on Answers on this topic. Could you perhaps explain what is unique about your situation that is making this difficult?
The link you shared addresses sharing data inside one app using properties. It does not address passing the data to a second app.
The specific link you want is this one: Sending information to the dialog box. In this example, the dialog box is the second app.
Hidd_1
Hidd_1 2022년 5월 10일
편집: Hidd_1 2022년 5월 10일
I did the first step, which is writing the function in the 2ed app:
function startupFcn(app, info_1, data_1)
app.StatisticsUIFigure.Name = sprintf('Statistics');
end
for the second step, the call back function in the 1st app, I still have problems, I wrote the following code:
function StatisticsButtonPushed(app, event)
Statistics
end
I don't know how to change it in order to pass the (info_1, and data_1) to the second app.
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개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 5월 5일

편집:

2022년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by