O'Reilly logo

Process Control: Modeling, Design, and Simulation by B. Wayne Bequette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

M1.5. Plotting

MATLAB has many nice graphics capabilities. Here, we will illustrate standard two-dimensional plots. First, generate two vectors for plotting

» x = 1:2:11;
» z = 5:5:30;

For a standard solid line plot, simply enter

» plot(x,z)

and Figure M1-2 appears. Axis labels are added by selecting “Insert” and specifying X label or Y label. Alternatively, in the command window you can use the following commands (perform this):

» xlabel('x')
» ylabel('z')
Figure M1-2. Example plot.

For more plotting options, type

» help plot

If we wish to plot discrete points, using + as a symbol, we can use the following (perform this):

 » plot(x,z,'+') ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required