Does anyone know how to run a function that displays a plot with a GUI button on that plot?

1 回表示 (過去 30 日間)
Andrew Stirnweis
Andrew Stirnweis 2017 年 4 月 19 日
回答済み: Chaitral Date 2017 年 4 月 24 日
I have a function that displays a solar systems with planets moving around a sun. I'm trying to add a GUI that allows you to add another planet at a distance and a size that you enter. I am wondering if it's possible to have the GUI button to do that display on the same plot that the solar system is on?

回答 (1 件)

Chaitral Date
Chaitral Date 2017 年 4 月 24 日
Add a pushbutton on the same plot and provide a callback to that Pushbutton. In a callback function, plot the planet at a distance and size you want just like you displayed other planets moving around sun in original function. To specify the distance and size, you can make use of Edit box. Once the string of the Edit box is updated, you can use those values in Pushbutton callback to add the planet with appropriate distance and size. I hope this helps.

カテゴリ

Help Center および File ExchangeEarth and Planetary Science についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by