classdef
appList < matlab.apps.AppBase
properties (Access = public)
UIFigure matlab.ui.Figure
ListBoxGUIdemoLabel matlab.ui.control.Label
EditField3 matlab.ui.control.NumericEditField
ResultLabel matlab.ui.control.Label
EnterSecondNumberLabel matlab.ui.control.Label
EnterFirstNumberLabel matlab.ui.control.Label
EditField2 matlab.ui.control.EditField
EditField matlab.ui.control.EditField
ListListBox matlab.ui.control.ListBox
ListListBoxLabel matlab.ui.control.Label
end
methods (Access = private)
function
CSESubjectListBoxValueChanged(app, event)
end
function
List1.ListBoxValueChanged(app, event)
value = app.List1.ListBox.Value;
value = get(handles.ListBox,
'value'
);
A Label = get(handles.edit1.
'String'
);
B label = get(handles.edit1.
'String'
);
A Label = Str2num(A);
B Label = Str2num(B);
end
end
methods (Access = private)
function
createComponents(app)
app.UIFigure = uifigure(
'Visible'
,
'off'
);
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name =
'MATLAB App'
;
app.ListListBoxLabel = uilabel(app.UIFigure);
app.ListListBoxLabel.HorizontalAlignment =
'right'
;
app.ListListBoxLabel.Position = [73 178 48 22];
app.ListListBoxLabel.Text =
'List '
;
app.ListListBox = uilistbox(app.UIFigure);
app.ListListBox.Items = {
'Add'
,
'Sub'
,
'Multiply'
,
'Division'
};
app.ListListBox.ValueChangedFcn = createCallbackFcn(app,
@ListListBoxValueChanged, true);
app.ListListBox.Position = [186 63 284 149];
app.ListListBox.Value =
'Add'
;
app.EditField = uieditfield(app.UIFigure,
'text'
);
app.EditField.Position = [307 356 163 45];
app.EditField2 = uieditfield(app.UIFigure,
'text'
);
app.EditField2.Position = [307 303 163 44];
app.EnterFirstNumberLabel = uilabel(app.UIFigure);
app.EnterFirstNumberLabel.Position = [73 356 156 45];
app.EnterFirstNumberLabel.Text =
'Enter First Number'
;
app.EnterSecondNumberLabel = uilabel(app.UIFigure);
app.EnterSecondNumberLabel.Position = [71 303 132 44];
app.EnterSecondNumberLabel.Text =
'Enter Second Number'
;
app.ResultLabel = uilabel(app.UIFigure);
app.ResultLabel.Position = [73 242 178 36];
app.ResultLabel.Text =
'Result'
;
app.EditField3 = uieditfield(app.UIFigure,
'numeric'
);
app.EditField3.Position = [307 231 163 43];
app.ListBoxGUIdemoLabel = uilabel(app.UIFigure);
app.ListBoxGUIdemoLabel.BackgroundColor = [0.3922 0.8314 0.0745];
app.ListBoxGUIdemoLabel.FontWeight =
'bold'
;
app.ListBoxGUIdemoLabel.Position = [71 426 420 33];
app.ListBoxGUIdemoLabel.Text =
'List Box GUI demo'
;
app.UIFigure.Visible =
'on'
;
end
end
methods (Access = public)
function
app = appList
createComponents(app)
registerApp(app, app.UIFigure)
if
nargout == 0
clear app
end
end
function
delete(app)
delete(app.UIFigure)
end
end
end