6.3. Multiple Plots

There are three different methods of drawing multiple plots in MATLAB:

6.3.1. Using plot Command

In this method, the earlier explained plot command in modified by providing more arguments to generate more plots in the same graphic window.

For example, let there be three plots to be drawn for three data sets, that is, (x1, y1), (x2, y2) and (x3, y3); then the plot command will be

plot(x1, y1, x2, y2, x3, y3);

This will generate three graphs in the same graphics window.

Example 6.8.

Illustrate the use of plot command for generating multiple plots.

Solution:

The following program illustrates the use of plot command for generating multiple plots:

% Program to illustrate ...

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.