basics signal plot in matlab
DESCRIPTION
unit step,ramp,parabolic signal pliot in matlabTRANSCRIPT
MIS No.141305012
Name:-Bhamare Kishor D.
Batch:-D
1) Program to Create Unit Impulse Signal in Matlab
clc;
clear all;
t=-20:0.01:20;
f=zeros(1,4001);
for i=1:4001;
if (t(i)==0)
f(i)=1;
else
f(i)=0;
end;
end;
plot(t,f);
Program to Create Unit Step Signal in Matlab
clc;
clear all;
t=-20:0.01:20;
f=zeros(1,4001);
for i=1:4001;
if (t(i)>0)
f(i)=1;
else
f(i)=0;
end;
end;
plot(t,f);
Program to Create Ramp Signal in Matlab
clc;
clear all;
t=-20:0.01:20;
f=zeros(1,4001);
for i=1:4001;
if (t(i)<0)
f(i)=0;
else
f(i)=t(i);
end;
end;
plot(t,f);
axis([-20 20 -5 30]);
grid on;
Program to Create Parabolic Signal in Matlab
clc;
clear all;
t=-20:0.01:20;
f=zeros(1,4001);
for i=1:4001;
if (t(i)<0)
f(i)=0;
else
f(i)=((t(i))^2)/2;
end;
end;
plot(t,f);
axis([-25 25 -5 500]);
grid on;
xlabel('Time(sec)');
ylebel('Magnitude');
Program to Create sine Function in Matlab
clc;
clear all;
t=-10:0.01:10;
f=sin(t);
plot(t,f);
grid on;
axis([-20 20 -2 2]);
xlabel('Time(sec)');
ylebel('Magnitude');