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 CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by