reset button gui matlab

5 Ansichten (letzte 30 Tage)
cyrine tijani
cyrine tijani am 11 Apr. 2021
Kommentiert: Walter Roberson am 14 Apr. 2021
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 ?

Antworten (1)

Walter Roberson
Walter Roberson am 11 Apr. 2021
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 Kommentare
cyrine tijani
cyrine tijani am 14 Apr. 2021
Walter Roberson
Walter Roberson am 14 Apr. 2021
%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);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Visual Exploration finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by