44
Chapter 3: Interacting with MATLAB % Remove old graphics, and get ready for several new ones. close all; axes; hold on % Run a loop to plot three sine curves. for c = 1:3 plot(x, sin(c*x)) echo off end echo on hold off % Put a title on the figure. title(’Several Sine Curves’) pause
The result is shown in Figure 3-1. Several Sine Curves 1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
0
Figure 3-1
1
2
3
4
5
6
7