How to change displayed plot in a GUI with pop-up menu.

4 ビュー (過去 30 日間)
Chris O'Shea
Chris O'Shea 2016 年 6 月 10 日
コメント済み: Chris O'Shea 2016 年 6 月 10 日
I am developing a GUI using guide for a function I have written which results in (a minimum) of 5 plot figures. Is there a way that i can use a popup menu (in which i already have the 5 plots as selectable items) to choose which plot the user sees? Presently the target axes (axes1) is populated with the last plot the function produces.

採用された回答

Joseph Cheng
Joseph Cheng 2016 年 6 月 10 日
編集済み: Joseph Cheng 2016 年 6 月 10 日
Yes.... look at the guide quick start templates. type in guide into the workspace and it'll open the quick start window. Select the GUI with Axes and Menu template and there is a example of plots, axis and button implementation. you can adjust the code and instead use the popup callback to do your plotting when that value changes. the implementation is similar to how the button update will do except you're checking changed value within the popup callback
  1 件のコメント
Chris O'Shea
Chris O'Shea 2016 年 6 月 10 日
Yes this worked, thank you. I was unaware of switch/case.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by