Graphing
Graphing
Although calculations are very useful, they can often be made more
meaningful via a visual presentation of the results. This can be
accomplished in Matlab by the plot function.
The function is remarkably simple - we only need to call the built-in
function plot with the independent variable as the first argument and the
dependent variable as the second argument, e.g. "plot(x,y)".
Of course, additional information, such as axis labeling, can be easily
added to the plot. This can be done by using command like title, grid,
axis, xlabel, and ylabel. Furthermore, values and captions can be placed
directly on top of the plot, using the text and gtext commands. Lastly,
using several different colors and shapes for the data makes it possible
to place several functions on the same plot.