App Designer Printing Code Results in GUI
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
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.
Respuestas (1)
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
0 comentarios
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!