How can i display output in text edit boxes?

5 visualizaciones (últimos 30 días)
Grace Frost
Grace Frost el 7 de Mayo de 2020
Comentada: Grace Frost el 7 de Mayo de 2020
So, this is my first time using Matlab and i am trying to create a project that simulates projectile motion in App Designer. It asks the user for initial values for velocity, x-position, y-position and theta. And i want it to output Time taken to reach max height, max height, range, velocity upoon impact, time of flight and final angle. So i have created a design view as show below:
This is the only code i have input into the code view:
When i run the app and input random variables for v, x-position, y-position, and theta, i get a display of this:
Which is great! But now i want to be able to automatically dispay the simulation outputs (tmaxh, maxh, range, v_impact, t_flight, theta_final) in the edit text boxes when the user presses the launch button. I've searched how and i just dont know where to start, please could someone give me some guidance on where to go with this.
Thank you in advance.

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 7 de Mayo de 2020
Grace - if you get values from the text edit controls as
x0 = app.initial_x_position.Value;
then you should be able to set in the same way
app.<your_tmaxh_control>.Value = tmaxh; % converting to string if necessary
where <your_tmaxh_control> is the name of the text control that you want to update.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by