0% found this document useful (0 votes)
24 views

Lab 1 Matlab

The document contains 5 sections describing polynomial functions, distance calculations, matrix operations, and convolution. Section 1 generates polynomial functions from coefficients and plots the results. Section 2 finds the roots of two polynomials. Section 3 calculates distance using the formula for linear motion. Section 4 performs matrix division. Section 5 demonstrates convolution on two vectors.

Uploaded by

donig
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lab 1 Matlab

The document contains 5 sections describing polynomial functions, distance calculations, matrix operations, and convolution. Section 1 generates polynomial functions from coefficients and plots the results. Section 2 finds the roots of two polynomials. Section 3 calculates distance using the formula for linear motion. Section 4 performs matrix division. Section 5 demonstrates convolution on two vectors.

Uploaded by

donig
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab 1

I.
x = 0:0.001:1;
y = [1 -2 1 -6.3];
Y=polyval(y,x);
plot(x,Y)

II.
x = 0:0.001:1;
y = [1 0.005 -3.14];
Y=polyval(y,x);
plot(x,Y)
2.
y = roots([1 0.005 -3.14])

y=

-1.7745
1.7695
y = roots([1 -2 1 -6.3])

y=

2.5667
-0.2833 + 1.5409i
-0.2833 - 1.5409i

3.
u=150;
a=20;
t=5;
distance=u*t+1/2*(a*t^2)

distance =

1000

4.
A=[2 -1 1 ;1 1 1 ;3 -1 -1 ]

A=

2 -1 1
1 1 1
3 -1 -1

B=[4 8 12]

B=

4 8 12

X=A/B

X=

0.0536
0.1071
-0.0357

A=[1 13 7 -75 1]
B=[17 0 0 3 0]
D=conv(A,B)
5.

i.
A=

1 13 7 -75 1

B=

17 0 0 3 0

D=

17 221 119 -1272 56 21 -225 3 0

ii.
A=

1 0 -4

B=

1 -2

xx =

1 2

R=

0 0 0

You might also like