www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/GraphTheCosineFunctionExample.m

    %% Plot Cosine Function
% Plot the cosine function over the domain $-\pi \leq x \leq \pi$.

% Copyright 2015 The MathWorks, Inc.

x = -pi:0.01:pi; 
plot(x,cos(x))
grid on