Delete plot in a loop

HI, im new in writing graph, i have this code to create a plot by pushbutton9:
//x=0;
global b;
for i=1:100
x=[x b];
plot(handles.axes3,x,'b--');
grid;
pause(1);
end
guidata(hObject,handles); //
I try to delete plot by pushbutton10, but the plot disappeared for a moment and then appeared again, how can i fix this ????

3 件のコメント

madhan ravi
madhan ravi 2019 年 4 月 11 日
what does "//" mean?
HANH TRAN
HANH TRAN 2019 年 4 月 11 日
編集済み: HANH TRAN 2019 年 4 月 11 日
Just note the code i write , dont worry about it
Rik
Rik 2019 年 4 月 11 日
// is the comment flag in C. In Matlab it will just cause a syntax error.
Since you don't show us what that pushbutton10 does, we can't tell why the plot is recreated.
Also, why are you using a global? You have the guidata struct right there to share variables between callbacks.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

製品

リリース

R2017a

タグ

質問済み:

2019 年 4 月 11 日

コメント済み:

Rik
2019 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by