0% found this document useful (0 votes)
49 views2 pages

Plot Continous Time Signal: Matlab Source Code

This MATLAB code defines a continuous time sinusoidal signal with an amplitude of 2, frequency of 100 Hz, and phase of pi/4 radians. It generates 201 samples over 3 periods and plots the signal, labeling the axes and adding a grid and axis limits. The output displays the plotted sinusoidal waveform.

Uploaded by

razakhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

Plot Continous Time Signal: Matlab Source Code

This MATLAB code defines a continuous time sinusoidal signal with an amplitude of 2, frequency of 100 Hz, and phase of pi/4 radians. It generates 201 samples over 3 periods and plots the signal, labeling the axes and adding a grid and axis limits. The output displays the plotted sinusoidal waveform.

Uploaded by

razakhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

LAB #1

PLOT CONTINOUS TIME SIGNAL


MATLAB SOURCE CODE

amp=2;
freq=100;
phase=pi/4;
T=1/freq;
t=0:T/200:3*T;
x=amp*sin(2*pi*freq*t+phase);
plot(t,x,'linewidth',2);

xlabel('time');
ylabel('amplitude');
title('continous time signal');
grid on;
axis([0 0.03 -2.5 2.5]);
set(gca,'XTick',0:0.01:0.03,'XminorTick','on');
set(gca,'YTick',-2.5:0.25:2.5,'YminorTick','on');

MATLAB OUTPUT
continous time signal
2.5
2.25
2
1.75
1.5
1.25
1
0.75
0.5
amplitude

0.25
0
-0.25
-0.5
-0.75
-1
-1.25
-1.5
-1.75
-2
-2.25
-2.5
0 0.01 0.02 0.03
time

You might also like