classdef sine_ploter < matlab.apps.AppBase
properties (Access = public)
UIFigure matlab.ui.Figure
ClearButton matlab.ui.control.Button
Slider matlab.ui.control.Slider
PlotButton matlab.ui.control.Button
UIAxes matlab.ui.control.UIAxes
methods (Access = private)
function PlotButtonPushed(app, ~)
function ClearButtonPushed(app, ~)
function SliderValueChanged(~, ~)
methods (Access = private)
function createComponents(app)
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Color = [1 1 1];
app.UIFigure.Position = [100 100 640 480];
app.UIFigure.Name = 'MATLAB App';
app.UIAxes = uiaxes(app.UIFigure);
title(app.UIAxes, 'Y=sin(X)')
app.UIAxes.GridColor = [0 0 1];
app.UIAxes.Position = [50 150 541 296];
app.PlotButton = uibutton(app.UIFigure, 'push');
app.PlotButton.ButtonPushedFcn = createCallbackFcn(app, @PlotButtonPushed, true);
app.PlotButton.Position = [122 31 150 43];
app.PlotButton.Text = 'Plot';
app.Slider = uislider(app.UIFigure);
app.Slider.Limits = [1 10];
app.Slider.ValueChangedFcn = createCallbackFcn(app, @SliderValueChanged, true);
app.Slider.Position = [233 132 175 3];
app.ClearButton = uibutton(app.UIFigure, 'push');
app.ClearButton.ButtonPushedFcn = createCallbackFcn(app, @ClearButtonPushed, true);
app.ClearButton.Position = [388 31 150 43];
app.ClearButton.Text = 'Clear';
app.UIFigure.Visible = 'on';
methods (Access = public)
function app = sine_ploter
registerApp(app, app.UIFigure)