(^6) Plot the peaks function in the axes. Add this command to the second line of the
AmplitudeSliderValueChanged callback:
plot(app.UIAxes,value*peaks)
Notice that the plot command specifies the target axes (app.UIAxes) as the first
argument. The target axes is always required when you call the plot command in
App Designer.
(^7) Change the limits of the y-axis by setting the YLim property of the UIAxes object.
Add this command to the third line of the AmplitudeSliderValueChanged
callback:
app.UIAxes.YLim = [-1000 1000];
Notice that the command uses dot notation to access the YLim property. Always use
the pattern app.Component.Property to access property values.
8
Click Run to save and run the app. After saving your changes, your app is
available for running again in App Designer, or by typing its name (without
the .mlapp extension) at the MATLAB command prompt. When you run the app from
the command prompt, the file must be in the current folder or on the MATLAB path.
14 App Designer Basics
ff
(ff)
#1