How can i display output in text edit boxes?
6 次查看(过去 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.
0 个评论
采纳的回答
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 Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!