How can i display output in text edit boxes?

8 次查看(过去 30 天)
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.

采纳的回答

Geoff Hayes
Geoff Hayes 2020-5-7
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by