% A sample program              file: unit8ex3.m
%  FALL 2001
%   ___________________________________
%  Jacob Y. Kazakia   jyk0
%  September 4, 2001
%  Recitation Instructor: J.Y.Kazakia
%  Recitation Section  01
%   ___________________________________

%   Purpose: This program plots the function
%             exp(alpha * x) * cos( omega * x )
%            for values of alpha and omega entered 
%            by the user. 
%   Algorithm: This is a simple evaluation of a formula


%  Print an announcement about the program
fprintf('\n\n This program plots the function \n ');
fprintf(' exp(alpha * x) * cos( omega * x ) \n ');
fprintf(' for values of alpha and omega entered  \n ');

             
%  PROMPT FOR AND READ THE INPUT

alpha = input(' \n\nEnter the parameter alpha >>>');
omega = input(' \n\nEnter the frequency omega >>>');

 
 %  calculation  
 
 x = 0 : 0.01 : 4;
 y = exp( alpha * x) .* cos( omega * x);
 plot ( x, y ), title('function for the given parameters');
 
 
 %  TRY THE VALUES alpha = -1.2 and beta = 45