0% found this document useful (0 votes)
49 views1 page

Lab Task # 1:: To Plot A CT Sinusoid: 5 Cosine Wave 5 Sine Wave

The document contains code to plot a sine wave and cosine wave using MATLAB. It defines constants for amplitude, frequency, and phase and generates time and signal arrays to plot a sine wave in the first part. The second part generates a cosine wave in a similar way and plots it in a separate figure. Both plots are labeled with titles, axes labels and a grid.
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 views1 page

Lab Task # 1:: To Plot A CT Sinusoid: 5 Cosine Wave 5 Sine Wave

The document contains code to plot a sine wave and cosine wave using MATLAB. It defines constants for amplitude, frequency, and phase and generates time and signal arrays to plot a sine wave in the first part. The second part generates a cosine wave in a similar way and plots it in a separate figure. Both plots are labeled with titles, axes labels and a grid.
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/ 1

LAB TASK # 1 :: TO PLOT A CT SINUSOID

% part-1
c =5;
f=1000;
ph=pi/4
T=1/f;
t=0:T/100:2*T;
x=c*sin(2*pi*f*t + ph);
figure(1);
plot(t,x,'linewidth',2);
title('Sine Wave');
xlabel('Time');
ylabel('Amplitude');
grid on;
% part-2
c=5;
f=1000;
ph=-pi/2;
T=1/f;
t=0:T/100:2*T;
x=c*cos(2*pi*f*t + ph);
figure(2);
plot(t,x,'linewidth',2);
title('Cosine Wave');
xlabel('Time');
ylabel('Amplitude');
grid on;
Sine Wave
5

Amplitude

Amplitude

Cosine Wave
5

0
-1

0
-1

-2

-2

-3

-3

-4

-4

-5

0.2

0.4

0.6

0.8

1
Time

1.2

1.4

1.6

1.8

2
-3

x 10

-5

0.2

0.4

0.6

0.8

1
Time

1.2

1.4

1.6

1.8

2
-3

x 10

You might also like