How can i display output in text edit boxes?

6 ビュー (過去 30 日間)
Grace Frost
Grace Frost 2020 年 5 月 7 日
コメント済み: Grace Frost 2020 年 5 月 7 日
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.
  1 件のコメント
Grace Frost
Grace Frost 2020 年 5 月 7 日
yes!! Got it to work - thank you so much Geoff

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by