reset button gui matlab

5 ビュー (過去 30 日間)
cyrine tijani
cyrine tijani 2021 年 4 月 11 日
コメント済み: Walter Roberson 2021 年 4 月 14 日
hi i'm using gui matlab and i want to put a reset button i used this instruction (cla(handles.axes1,'reset');) it worked but the axes became visible instead of invisible how can i fix that please any help ?

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 4 月 11 日
cla RESET deletes all objects (including ones with hidden handles)
and also resets all axes properties, except Position and Units, to
their default values.
The default property of 'visible' is 'on' and the default property of 'box' is 'on', so when you use 'reset' then you are asking for those properties to be turned on.
You could try immediately turning those properties off again, but you should consider the possibility that 'reset' is not the right approach for you.
  7 件のコメント
cyrine tijani
cyrine tijani 2021 年 4 月 14 日
Walter Roberson
Walter Roberson 2021 年 4 月 14 日
%setup -- only needs to be done with respect to one axes, not all of them
ax = handles.axes1(1);
ax.Visible = 'off'; ax.Box = 'off';
props_to_ignore = {'BeingDeleted', 'Legend', 'Parent', 'Position', 'SubTitle', 'Title', 'Type', 'XAxis', 'YAxis', 'ZAxis'};
handles.ax_setable_properties = setdiff( fieldnames(set(ax)), ax_props_to_ignore);
handles.ax_master_props = get(ax, ax_setable_properties);
guidata(ax, handles);

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

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by