ABSTRACT

To plot multiple curves on a single graph, one can use the plot command with multiple arguments, such as

plot(x1, y1, x2, y2, x3, y3, ..., xn, yn)

The variables x1, y1, x2, y2, etc., are pairs of vectors. Each x-y pair is graphed, generating multiple lines on the plot. The above plot command allows vectors of different lengths to be displayed on the same graph. MATLAB automatically scales the plots. Also, the plot remains as the current plot until another plot is generated; in which case, the old plot is erased. The hold command holds the current plot on the screen, and inhibits erasure and rescaling. Subsequent plot commands will overplot on the original curves. The hold command remains in effect until the command is issued again.