How to clear data from plot in matlab GUI, but then re-plot it without re-running the GUI

7 ビュー (過去 30 日間)
Matthew Saul
Matthew Saul 2014 年 12 月 18 日
回答済み: Shoaibur Rahman 2014 年 12 月 20 日
I have made a GUI that plots multiple data sets using a radio button for each data set. I have made a CLEAR ALL button, that when the user presses it, I want all the data from the plot to be removed. I have this working, but then when I re toggle the radio buttons again the data does not start plotting on the plot again. Is there a way I can do this?

回答 (1 件)

Shoaibur Rahman
Shoaibur Rahman 2014 年 12 月 20 日
Use cla under the Callback function of your button. Don't use clear all command, as it clears all variables. Examples:
cla(handles.axes1)
cla(handles.axes2)
cla(handles.axes3)
...
...

カテゴリ

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