Table B.2 Color options
Plots may be annotated with title, xlabel, and ylabel commands. For
title(`Time-domain signal x(n)');
where title gives the plot with the title `Time-domain signal x(n)', xlabel labels the
x-axis with `Time index' and ylabel labels the y-axis with `Amplitude'. Note that these
commands can be written in the same line.
By default, MATLAB automatically scales the axes to fit the data values. However,
we can override this scaling with the axis command. For example, the plot statement
axis([xmin xmax ymin ymax]);
sets the scaling limits for the x- and y-axes on the current plot. The axis command
must follow the plot command to have the desired effect. This command is especially
useful when we want to compare curves from different plots using the identical scale.
The axis command may be used to zoom-in (or zoom-out) on a particular section of
the plot. There are some predefined string-arguments for the axis command. For
sets equal scale on both axes, and
sets the default rectangular graphic frame to a square.
The command plot(x,y)assumes that the x and y axes are divided into equally
spaced intervals; these plots are called linear plots. The MATLAB commands can also
generate a logarithmic scale (base 10) using the following commands:
APPENDIX B: INTRODUCTION OF MATLAB FOR DSP APPLICATIONS