% the following program is used to draw graphs of three basic trignometric
% functions
clear
clc
A=1;
ph=0;
fprintf('if a problem occurs while execution please enter CTRL+C for termination\n\n\n');
choice = input('which trig. function you want to draw, enter "s" for sin , eneter "c" for cos, and for tan enter "t": ' );
if (choice==s)
fprintf('the sine function will be drawn using this equation, A.*sin(x+ph)\n');
drawFunction = A.*sin(x+ph);
fprintf('please enter the range for the graph\n');
min = input('enter lower range value: ');
max = input('enter maximum value for your range: ');
range = [min:0.01:max];
default1=input('do you want to change default values, "1" and "0" for "A" and "ph" respectively? If no, then press "n", otherwise, "y"\n: ');
if (default1==y)
A = input('enter value for "A": ');
ph = input('enter value for phase angle: ');
else
plot(x,drawFunction,'r','-.'),xlabel('x'),ylabel('y'),legend('sin(x)')
end
end