How to turn off GUI settings shwon in Command Window

3 views (last 30 days)
Always when i enter something in an "Edit Text" or press a Pushbutton my GUI is showing a lot of settings (see at the end of the question) in the Command Window. I don't know what command makes the GUI display all of these settings. The whole code is about 2500 lines long and so it would be nice to have some idea where to look if an " ; " is missing somewhere.
Thanks a lot for all your ideas :)
(This is shown in the Command Window:)
ALim: {}
ALimMode: {'auto' 'manual'}
ActivePositionProperty: {1×2 cell}
AmbientLightColor: {1×0 cell}
Box: {'on' 'off'}
BoxStyle: {'full' 'back'}
BusyAction: {'queue' 'cancel'}
ButtonDownFcn: {}
CLim: {}
CLimMode: {'auto' 'manual'}
CameraPosition: {}
CameraPositionMode: {'auto' 'manual'}
CameraTarget: {}
CameraTargetMode: {'auto' 'manual'}
CameraUpVector: {}
CameraUpVectorMode: {'auto' 'manual'}
CameraViewAngle: {}
CameraViewAngleMode: {'auto' 'manual'}
Children: {}
Clipping: {'on' 'off'}
ClippingStyle: {'rectangle' '3dbox'}
Color: {1×0 cell}
ColorOrder: {}
ColorOrderIndex: {}
CreateFcn: {}
DataAspectRatio: {}
DataAspectRatioMode: {'auto' 'manual'}
DeleteFcn: {}
FontAngle: {'normal' 'italic'}
FontName: {}
FontSize: {}
FontSmoothing: {'on' 'off'}
FontUnits: {1×5 cell}
FontWeight: {'normal' 'bold'}
GridAlpha: {}
GridAlphaMode: {'auto' 'manual'}
GridColor: {1×0 cell}
GridColorMode: {'auto' 'manual'}
GridLineStyle: {1×5 cell}
HandleVisibility: {'on' 'callback' 'off'}
HitTest: {'on' 'off'}
Interruptible: {'on' 'off'}
LabelFontSizeMultiplier: {}
Layer: {'bottom' 'top'}
LineStyleOrder: {}
LineStyleOrderIndex: {}
LineWidth: {}
MinorGridAlpha: {}
MinorGridAlphaMode: {'auto' 'manual'}
MinorGridColor: {1×0 cell}
MinorGridColorMode: {'auto' 'manual'}
MinorGridLineStyle: {1×5 cell}
NextPlot: {1×4 cell}
OuterPosition: {}
Parent: {}
PickableParts: {'visible' 'none' 'all'}
PlotBoxAspectRatio: {}
PlotBoxAspectRatioMode: {'auto' 'manual'}
Position: {}
Projection: {1×2 cell}
Selected: {'on' 'off'}
SelectionHighlight: {'on' 'off'}
SortMethod: {'depth' 'childorder'}
Tag: {}
TickDir: {'in' 'out' 'both'}
TickDirMode: {'auto' 'manual'}
TickLabelInterpreter: {'none' 'tex' 'latex'}
TickLength: {}
Title: {}
TitleFontSizeMultiplier: {}
TitleFontWeight: {'normal' 'bold'}
UIContextMenu: {}
Units: {1×6 cell}
UserData: {}
View: {}
Visible: {'on' 'off'}
XAxis: {}
XAxisLocation: {1×3 cell}
XColor: {1×0 cell}
XColorMode: {'auto' 'manual'}
XDir: {'normal' 'reverse'}
XGrid: {'on' 'off'}
XLabel: {}
XLim: {}
XLimMode: {'auto' 'manual'}
XMinorGrid: {'on' 'off'}
XMinorTick: {'on' 'off'}
XScale: {'linear' 'log'}
XTick: {}
XTickLabel: {}
XTickLabelMode: {'auto' 'manual'}
XTickLabelRotation: {}
XTickMode: {'auto' 'manual'}
YAxisLocation: {1×3 cell}
YColor: {1×0 cell}
YColorMode: {'auto' 'manual'}
YDir: {'normal' 'reverse'}
YGrid: {'on' 'off'}
YLabel: {}
YLim: {}
YLimMode: {'auto' 'manual'}
YMinorGrid: {'on' 'off'}
YMinorTick: {'on' 'off'}
YScale: {'linear' 'log'}
YTick: {}
YTickLabel: {}
YTickLabelMode: {'auto' 'manual'}
YTickLabelRotation: {}
YTickMode: {'auto' 'manual'}
ZAxis: {}
ZColor: {1×0 cell}
ZColorMode: {'auto' 'manual'}
ZDir: {'normal' 'reverse'}
ZGrid: {'on' 'off'}
ZLabel: {}
ZLim: {}
ZLimMode: {'auto' 'manual'}
ZMinorGrid: {'on' 'off'}
ZMinorTick: {'on' 'off'}
ZScale: {'linear' 'log'}
ZTick: {}
ZTickLabel: {}
ZTickLabelMode: {'auto' 'manual'}
ZTickLabelRotation: {}
ZTickMode: {'auto' 'manual'}
  3 Comments
Niklas Hahn
Niklas Hahn on 28 Aug 2018
Edited: Niklas Hahn on 28 Aug 2018
Thank you for the quick answer. I've just gone through all set, get, delete, axis or axes but behind each line is an semi-colon.
In the GUI is one axes and up to 18 different plots are shown there for different calculations. With checkboxes I turn the 'visible' (-ity) on or off (via the set-command).
Two specific 'Edit Text' fields are right next to the axes to change the maximum Values of the axes. For example the code for the 'Edit Text' that changes the y-axis is the following one. Usually these 4 lines of code should not be displaying all of these settings i mentioned before.
function edit38_Callback(hObject, eventdata, handles)
% hObject handle to edit38 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit38 as text
% str2double(get(hObject,'String')) returns contents of edit38 as a double
x_max = str2double(get(handles.edit39,'String'));
y_max = str2double(get(hObject, 'String'));
set(handles.axes1);
axis([0 x_max 0 y_max]);
Geoff Hayes
Geoff Hayes on 28 Aug 2018
The above lines of code look fine so I don't know for sure (without seeing all of your code) what may be responsible for the above output...

Sign in to comment.

Accepted Answer

Jan
Jan on 28 Aug 2018
Edited: Jan on 28 Aug 2018
The shown output is created by
set(handles.axes1);
See: help set:
A = set(H)
set(H)
returns or displays the names of the user-settable properties and
their possible values for the object with handle H.
Omit this line, because it has no purpose at all. Most likely you want to do this instead:
axes(handles.axes1);
But this is not efficient. Changing the current axes is prone to bugs, because when the user clicks on an object during the processing, the current axes changes unexpectedly. Better define the parent property:
axis(handles.axes1, [0 x_max 0 y_max]);
By the way: You can use the debugger to find the line, which causes the output. Simply set some breakpoints in the code and step through the program line by line. Then it is obvious, when the output is created.
  2 Comments
Niklas Hahn
Niklas Hahn on 28 Aug 2018
Thank you so much :)
If I have two axes (axes1 and axes2) in my GUI (maybe later on), would it then be required to use
set(handles.axes1);
to say that I want to change the axis of axes1 in particular?
And is there a reason why there is output generated by set(handles.axes1); even if there is a semi-colon?
Jan
Jan on 28 Aug 2018
Edited: Jan on 28 Aug 2018
@Niklas: As mentioned in the answer: Prefer to define the wanted axes as parent property. This works for all commands to create or control graphics.
According to the documentation, the set commands displays the possible values of the user-settable properties. A semicolon suppresses only the output of the current values. Try this in the command window:
H = axes;
H
H;
set(H)
set(H);
It is equivalent to disp(8); which shows the "8" in spite of the semicolon also.

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!