How to fix the clear button in GUI
3 ビュー (過去 30 日間)
古いコメントを表示
How to fix the clear button that when I click it, it does not change the axis limits back to (0-1) and keep them
(-200 - 200).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820515/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/820520/image.png)
3 件のコメント
Rik
2021 年 12 月 2 日
Since this is a GUI, you should get into the habit of specifying the target axis in your calls to xlim and ylim (and any other graphics function). It will probably not matter in this case, but if you forget it when it does matter it will be difficult to debug.
回答 (1 件)
Cris LaPierre
2021 年 12 月 28 日
Following up on what Rik said, the following is how you would create the callback for Clear in app designer.
% Button pushed function: ClearButton
function ClearButtonPushed(app, event)
cla(app.UIAxes,'reset')
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!