Effacer les filtres
Effacer les filtres

App Designer Printing Code Results in GUI

15 vues (au cours des 30 derniers jours)
Daniel Seligman
Daniel Seligman le 10 Août 2020
I am creating an app in in App Designer in which I run a program and need the results printed in the GUI and not just the Matlab Command Window. I am fairly new to Matlab and don't have much experience with programming at all. The results will be quite long and I do not know if that makes a difference. If anybody could help me, I would be greatly appreciative.
  2 commentaires
Geoff Hayes
Geoff Hayes le 10 Août 2020
Daniel - what can you tell us about the resutls? Are they suited to being displayed in a table or in a text field? Please provide some details.
Daniel Seligman
Daniel Seligman le 10 Août 2020
The results will be best suited for a text field. There will be about 60 lines of text that will come from my program. It's all important and all needs to be available. Is there anything else that is important to know? Thank you.

Connectez-vous pour commenter.

Réponses (1)

Sourabh Kondapaka
Sourabh Kondapaka le 13 Août 2020
Hi,
You could use the “evalc()” function to capture the output of a matlab program or even a matlab command.
Then you could change the value of the Label in by accessing the “Text” property of the Label in App Designer.
I’m assuming you would want to run a program on a button click and then capture the output of that program and display it on a label.
Please make sure that the MATLAB program that you are trying to run is in the search path of MATLAB.
If you like to know how to add the a new directory to MATLAB search path, you can refer to the links here and here.
Here ‘tryOut.m’ is the MATLAB program that I’m trying to run.
% Button pushed function: Button
function ButtonPushed(app, event)
output = evalc('tryOut');
app.Label.Text = output;
end

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by