Borrar filtros
Borrar filtros

App Designer Printing Code Results in GUI

15 visualizaciones (últimos 30 días)
Daniel Seligman
Daniel Seligman el 10 de Ag. de 2020
Respondida: Sourabh Kondapaka el 13 de Ag. de 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 comentarios
Geoff Hayes
Geoff Hayes el 10 de Ag. de 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 el 10 de Ag. de 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.

Iniciar sesión para comentar.

Respuestas (1)

Sourabh Kondapaka
Sourabh Kondapaka el 13 de Ag. de 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

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by