Why? Why me? Why can't you do it just using
t=0:.05:40
and the plot() function?
s = -2 * etc.
y = A * cos(etc.
plot(t, y, 'b-');
Sounds like homework and something simple enough for you to do.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!