MATLAB: Need help graphing this

graph a cosine

How do you graph y = cosx and y = 5 + cosx over the interval [0,4pi]?
I also want to use the command "ylim([-2,7]) in order to view the graph clearly.
I just installed Matlab and it is my first time using this software. Thanks

Best Answer

x = 0:0.01:4*pi;
plot(x,cos(x));hold on;
plot(x,5+cos(x));
ylim([-2 7])