Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
55 views

Basics Signal Plot in Matlab

The document contains 5 MATLAB programs that generate different types of signals: 1) A unit impulse signal with a value of 1 at t=0 and 0 elsewhere. 2) A unit step signal with a value of 1 for t>0 and 0 otherwise. 3) A ramp signal with a value of t for t>0 and 0 otherwise. 4) A parabolic signal with a value of t^2/2 for t>0 and 0 otherwise. 5) A sine wave signal generated using the sin(t) function.

Uploaded by

Kishor Bhamare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Basics Signal Plot in Matlab

The document contains 5 MATLAB programs that generate different types of signals: 1) A unit impulse signal with a value of 1 at t=0 and 0 elsewhere. 2) A unit step signal with a value of 1 for t>0 and 0 otherwise. 3) A ramp signal with a value of t for t>0 and 0 otherwise. 4) A parabolic signal with a value of t^2/2 for t>0 and 0 otherwise. 5) A sine wave signal generated using the sin(t) function.

Uploaded by

Kishor Bhamare
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

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');

You might also like