MATLAB Answers

How to print mathematical equations in menu

1 ビュー (過去 30 日間)
Thai Tran
Thai Tran 2020 年 12 月 29 日
コメント済み: Walter Roberson 2020 年 12 月 29 日
I'm having trouble with how to print mathematical equation in menu:
Here's my code:
choice = menu("I want to print equation here", 'Plot trajectory', 'Calculate acceleration');
And this is equations i want to print:
x = 3*t - t^3
y = 4*t^2
Any idea how to do this? Thank you very much
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 29 日
Do they need to be formatted somehow, such as raised exponent? If so then that cannot be done with menu(). Also line break cannot be done with menu()


回答 (1 件)

Les Beckham
Les Beckham 2020 年 12 月 29 日
I expect that what you want is not as simple as this, but as an initial guess at what you are looking for, try this.
I don't believe that you can get pretty LaTex equations in a menu.
choice = menu(sprintf('%s\n%s', 'x = 3*t - t^3', 'y = 4*t^2'), 'Plot trajectory', 'Calculate acceleration')



Community Treasure Hunt

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

Start Hunting!

Translated by