%--------------------------------------------------------
% Generation of x(n)=cos(w_0 n)
%   Created by Aly El-Osery
%   Modified: Sept. 11, 2006
%--------------------------------------------------------_

m=input('Input values for w_0=');

n=0:20;

y=cos(n'*m);

for i=1:length(m),
    subplot(length(m)/2,2,i),stem(y(:,i))
    grid on
    xlabel('n')
    ylabel('y(n)')
    % num2tr changes a numerical value to a string
    title(['w_0=',num2str(m(i)/pi),'pi'])  
end
