Basics of MATLAB
The bread-and-butter of matlab graphics is the plot command. The elements of the vectors were plotted in order and joined by straight line segments. There are many options for changing the appearance of a plot. The contour function plots the contours using the current colour map’s colours. Adding the specifier ‘k’ to the end of the argument list draws the contours in black. The spanplot function is nonstandard and is included in the companion software. Functions are m-files that can be used to extend the matlab language. Functions can accept input arguments and produce output arguments. Many of matlab’s own commands are implemented as m-files; try typing type mean to see how matlab calculates the mean. Functions use variables that are local to themselves and do not appear in the main workspace. The tests in flow control statements often involve strings.