Hi 邱,
I get that you have a script that you want to continue executing once you have gathered that data from the app getting executed in the background.
You can achieve the desired behaviour using uiwait and uiresume with the steps mentioned below:
- Use the uiwait function to pause the execution of the main script after the 'sub.mlapp' is launched.
- Create a button in the 'sub.mlapp' and in its callback function gather the necessary data and use uiresume function to continue the main script. E.g.
subdata.data1 = [app.SomeValue1, app.SomeValue2];
setappdata(0, 'subdata', subdata);
Please note that above provided example is just an illustration of the workaround you can follow. Ensure that the data you need is properly set in the 'sub.mlapp' before calling uiresume.
You can visit these documentation links to know more about uiresume and uiwait functions:
- https://www.mathworks.com/help/matlab/ref/uiresume.html
- https://www.mathworks.com/help/matlab/ref/uiwait.html
I hope it helps in achieving the desired behaviour.