Using MATLAB app after cascaded call of other MATLAB app not possible anymore

59 次查看(过去 30 天)
Hallo togehter,
I have the following problem: I coded a application with the help of the MATLAB app designer (Lets call it main app). Within this application user imports are quite commen. Therefore with pushing a button within the app a new application created with the MATLAB app designer is openend (lets call it second app). Within the second app a additional user import is necessary to get all the information the second app should collect. So by pushing a button within the second app a additional app designed with the app designer is executed (lets call it third app). Now I face the problem, that after the user performed all necessary task within the third app and pushind the export button the third app gets closed but I can not access the second app. It of course still appears but I hear only the error sound if a try to push a button or change a value of a edit field within the second app.
In general I call the cascaded apps (in the callback function of the main and second app) like this:
app_new_SecondApp = SecondApp();
waitfor(app_new_SecondApp);
I tried to face the problem with the following additional code within the callback function of import button pushed within the second app:
app_UserDialog = Interface_UserDataImport();
waitfor(app_UserDialog);
delete app_UserDialog;
app.SecondAppUIFigure.RunningAppInstance.SecondAppUIFigure.HandleVisibility = "on";
set(0,'CurrentFigure',app.SecondAppUIFigure.RunningAppInstance.SecondAppUIFigure);
drawnow;
pause(1);
With this code I could force the second app to be the current figure (gcf) and not the main app. But still no interaction with the second app is possible.
Everything works fine if I only execute the second app without the step by pushing a button in the main app.
Can anybody help me?
Thanks a lot!
  1 个评论
Nicolas Kaiser
Nicolas Kaiser 2024-7-17,13:40
编辑:Nicolas Kaiser 2024-7-17,13:40
I just figured out, that the problem appeared not after calling the third app but after calling the uigetfile dialog. Could it be that the first waitfor in the callback function of the button pushed at the main app is causing the problem?

请先登录,再进行评论。

回答(0 个)

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by