appdesigner output as of R2020a
Ältere Kommentare anzeigen
as of R2020a, is matlab appdesigner able to have an output?
i am trying to have the output be imported to a text file
the output will be coordinates in an array
Akzeptierte Antwort
Weitere Antworten (1)
Michael
am 21 Apr. 2023
A bit late of a response, but here's an approach to have output arguments for an appdesigner app without using assignin, for anyone that's searching for this:
1) In your appdesigner app, add a property for each variable you want to return
2) Also in the app, add a property called 'readyToExit'
3) Add a button to your GUI, with a button pushed callback that does this:
app.readyToExit = true;
4) Write a .m file to call the app like:
app = appName(inputArg);
%Here, the user interacts with the app like normal. waitfor blocks execution until the 'readyToExit' property is set to true by the button press
waitfor(app,'readyToExit',true);
%retrieve output from the GUI, now that the button has been pressed
outputArg1 = app.outputArg1;
outputArg2 = app.outputArg2;
%close the app
delete(app);
5) Instead of calling your app directly, call the .m file:
[outputArg1, outputArg2] = runApp(inputArg);
This will give you an appdesigner app that acts like a modal GUI.
Kategorien
Mehr zu Downloads finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!