Sie sind auf Seite 1von 6

Lab. No.

: 03

Plotting of Continuous time waveforms in MATLAB.


Tools: PC, Matlab

Lab. Objective: To get simulation skills in Matlab for plotting of different analog signals and
sequences.

Vectors Plotting in Matlab

%%Plotting of Vectors in Matlab%%

% Defining Vector

X=[1 2 3 4 5];

%Plot of Vector

plot(X)

4.5

3.5

2.5

1.5

1
1 1.5 2 2.5 3 3.5 4 4.5 5

Figure 1: Vector Plot

Plotting of Matrix Values in Matlab

%%Plotting of Matrix values in Matlab%%

% Defining Matrix

X=[1 2 3; 4 5 6; 7 8 9];

%Plot of Matrix

plot(X)
9

1
1 1.2 1.4 1.6 1.8 2 2.2 2.4 2.6 2.8 3

Figure 2: Matrix Plot

Sine wave plotting in Matlab

%%Sine wave plotting in Matlab%%

% Defining time interval

t=[0:.01:10];

%Defining sine waveform

A=2;

y=2*A*sin(t)

%Plotting the waveform

plot(t,y)

-1

-2

-3

-4
0 1 2 3 4 5 6 7 8 9 10

Figure 3: Sine Graph


Cosine waveform wave plotting in Matlab

% Defining time interval

t=[0:.01:15];

%Defining cosine waveform

A=2;

y=2*A*cos(t)

%Plotting the waveform

plot(t,y)

-1

-2

-3

-4
0 5 10 15

Figure 4: Cosine Graph

Plotting Tangent waveform

%%Tangent waveform wave plotting in Matlab%%

% Defining time interval

t=[0:.01:10];

%Defining Tangent waveform

A=4;

y=2*A*tan(t)

%Plotting the waveform

plot(t,y)
12000

10000

8000

6000

4000

2000

-2000
0 1 2 3 4 5 6 7 8 9 10

Figure 5: Tangent Graph

Exponential signal plotting

%%Growing Exponential waveform wave plotting in Matlab%%

% Defining time interval

t=[0:.01:10];

%Defining Exponential waveform

a=4;

y=exp(a*t);

%Plotting the waveform

plot(t,y)
17
x 10
2.5

1.5

0.5

0
0 1 2 3 4 5 6 7 8 9 10

Figure 6: Growing Exponential Graph

%%Decaying Exponential waveform wave plotting in Matlab%%

% Defining time interval


t=[0:.1:10];

%Defining Exponential waveform

a=-5;

y=exp(a*t);

%Plotting the waveform

plot(t,y)

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
0 1 2 3 4 5 6 7 8 9 10

Figure 7: Decaying Exponential Graph

Trignometric expression plotting

%%Trignometric expression waveform plotting in Matlab%%

% Defining time interval

t=[0:.1:10];

%Defining Exponential waveform

f=50;

y=-5*sin(2*pi*f*t)+10*cos(2*f*t);

%Plotting the waveform

plot(t,y)
10

-2

-4

-6

-8

-10
0 1 2 3 4 5 6 7 8 9 10

Figure 8: Trignometric Expression Graph

Lab. Assignment

Plot waveform of the given mathematical equation.

Y=10x8-5x6/2x2-x

Das könnte Ihnen auch gefallen