362 Introduction to C++ Programming and Graphics
- Graph of the function:f(x)=sin^3 (πx)
 
>> x=-1.0:0.01:1.0; % define an array of abscissae
>> y = sin(pi*x).^3; % note the .^ operator (Table F.1.1)
>> plot(x,y)
>> set(gca,’fontsize’,15)
>> xlabel(’x’,’fontsize’,15)
>> ylabel(’y’,’fontsize’,15)−1−1 −0.5 0 0.5 1−0.8−0.6−0.4−0.200.20.40.60.81xy- Graph of the Gaussian function:f(x)=e−x
2 
>> fplot(’exp(-x^2)’,[-5, 5])
>> set(gca,’fontsize’,15)
>> xlabel(’x’,’fontsize’,15)
>> ylabel(’y’,’fontsize’,15)−5^0050.10.20.30.40.50.60.70.80.91xy