How can i display output in text edit boxes?

2 vues (au cours des 30 derniers jours)
Grace Frost
Grace Frost le 7 Mai 2020
Commenté : Grace Frost le 7 Mai 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.

Réponse acceptée

Geoff Hayes
Geoff Hayes le 7 Mai 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.
  1 commentaire
Grace Frost
Grace Frost le 7 Mai 2020
yes!! Got it to work - thank you so much Geoff

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by