Upload
iftikhar-ali
View
114
Download
0
Embed Size (px)
Citation preview
Matlab project
Title : Different Function with Graphs
Made by Iftikhar ali
Cell +92-346-9383505
About project
My project consist of different function :1:) To Generate A Matrix
2:) To Represent The Harmonics of a Signal
3:) To represent unit impusle
4:) To represent the descrete unit step function graph of a signal
5:) To represent the continous unit step function graph of a signal
6:) To represent the ramp function graph of a signal
7:) To find the convolution of the signal
8:) To find the graph of cosin function
9:) To find the graph of sin function
Application:
: it make easy to graph different function:it have a function to get random matrix as will as ones matrix
:it have also a function of harmonic signal
:it have also function of flipping:it have also function of ramp function
:it have also unit impuls and unit step function
We see that all the above function have very use in daily life .so our project is on the base of all above mentioned function
Function coding:function y=pro()disp('"0" To Generate A Matrix ')disp('"1" To Represent The Harmonics of a Signal ')disp('"2" To represent unit impusle of a signal ')disp('"3" To represent the descrete unit step function graph of a signal ')disp('"4" To represent the continous unit step function graph of a signal ')disp('"5" To represent the ramp function graph of a signal ')disp('"6" To find the convolution of the signal')disp('"7" To find the graph of cosin function ')disp('"8" To find the graph of sin function ')s=input('Enter The Opperation You want = '); switch scase 0 n=input('Enter the number of ROWS = '); m=input('Enter the number of COLUMS = '); disp('the random "n x m" matrix is given below :'); rand(n,m)case 1 n=input('Enter n-th Harmonic= '); inc=0.01; f=1; t=0:inc:4; w=2*pi*f;for i=1:n signal=sin(i*t*w); plot(t,signal) pause;end case 2 n1=input('enter the initinal point='); n2=input('enter the final point='); n0=input('enter the point for the impulse which you want='); n=n1:n2; x=[(n-n0)==0]; stem(n,x); case 3 n1=input('enter the initinal point='); n2=input('enter the final point='); n0=input('enter the point which you want to draw the descrete unit step function graph ='); n=n1:n2; x=[(n-n0)>=0]; stem(n,x); case 4 t1=input('enter the initinal point='); t2=input('enter the final point='); inc=input('enter for the increment='); t0=input('enter the point which you want to draw the continous unit step function graph ='); t=t1:inc:t2; x=[(t-t0)>=0]; plot(t,x); case 5 t1=input('enter the initinal point=');
t2=input('enter the final point='); inc=input('enter for the increment='); t0=input('enter the point which you want to draw the ramp function ='); t=t1:inc:t2; x1=[(t-t0)>=0]; x=x1.*(t-t0); plot(t,x); case 6 p=input('Enter the initinal value of "n" on axis = '); o=input('Enter the final value of "n" on axis = '); n=p:o; n k=input('Enter the initinal value of "m" on axis = '); l=input('Enter the final value of "m" on axis = '); m=k:l; m disp('put the input function "x" on "n" axis point ' ) for n=p:o x=input('give the descrete input function value='); end x disp('put the impulse response function "h" on "m" axis point ' ) for m=k:l h=input('give the descrete impulse response function value='); end disp('the convolution as:'); conv(x,h) case 7 A=input('put the cosine function magnitude='); f=input('put the frequency of cosine function='); b=input('enter the initinal point for the axis='); c=input('enter the final point for the axis='); t=b:0.001:c; y=A*cos(2*pi*f*t); plot(t,y); case 8 A=input('put the sin function magnitude='); f=input('put the frequency of sin function='); b=input('enter the initinal point for the axis='); c=input('enter the final point for the axis='); t=b:0.001:c; y=A*sin(2*pi*f*t); plot(t,y); otherwise disp('Please Select Opperation From "0","1","2","3","4","5","6","7","8","9","10"<== ')endend