%cosine.m
% m-file function to generate a cosine wave.
% called by series.m the main program which
% also calls squarewv.m, sawtoothwv.m, and triangwv.m.
% calls m-file fftamps.m

function  [y,yplot] = cosine(Amp,off,phase,w1,t)


phs=phase*pi/180;
y=Amp*cos(w1*t - phs) + off;
yplot=[y(:); y(:)];

%text(.35,.4,['Period=',num2str(T),' Amp= ',num2str(Amp),' Mean= ',num2str(off)],'sc')
%text(.35,.37,['Phase= ',num2str(phase),' Fundamental freq= ',num2str(f1)],'sc')
%text(.35,.34,['Variance= ', num2str(variance)],'sc')
%title(['Period=',num2str(T),' Phase= ',num2str(phase),' Amp= ',num2str(Amp),' Mean= ',num2str(off),' variance= ',num2str(variance)])

