EE Comp MATLAB Activity 1
EE Comp MATLAB Activity 1
EE Comp MATLAB Activity 1
COLLEGE OF ENGINEERING
>> i=4*a
i = 8 12 4 20 i(x) = 8x3 + 12x2 + 4x + 20
>> j=5*b
j = 25 40 35 30 j(x) = 25x3 + 40x2 + 35x + 30
>> k=6*c
k = 54 36 24 42 k(x) = 54x3 + 36x2 + 24x + 42
>> l=7*d
l = 70 14 35 49 l(x) = 70x3 + 14x2 + 35x + 49
3. Polynomial Roots
The roots are:
>> m=roots(a)
m = -1.9186 m = -1.9186,
0.2093 + 1.1222i 0.2093 + 1.122j, and
0.2093 - 1.1222i 0.2093 - 1.122j
>> n=roots(b)
n =-1.2485 n = -1.2485,
-0.1757 + 0.9645i -0.1757 + 0.9645, and
-0.1757 - 0.9645i -0.1757 - 0.9645
>> o=roots(c)
o = -1.0000 o = -1,
0.1667 + 0.8660i 0.1667 + 0.8660j, and
0.1667 - 0.8660i 0.1667 - 0.8660j
>> p=roots(d)
p = 0.2791 + 0.9194i p = -0.7582 ,
0.2791 - 0.9194i 0.2791 + 0.9194j, and
-0.7582 0.2791 - 0.9194j
>> poly(m)
ans = 1.0000 1.5000 0.5000 2.5000 m(x) = x3 + 1.5x2 + 0.5x + 2.5
>> poly(n)
ans =1.0000 1.6000 1.4000 1.2000 n(x) = x3 + 1.6x2 + 1.4x + 1.2
>> poly(o)
ans =1.0000 0.6667 0.4444 0.7778 o(x) = x3 + 0.67x2 + 0.44x + 0.78
>> poly(p)
ans = 1.0000 0.2000 0.5000 0.7000 p(x) = x3 + 0.2x2 + 0.5x + 0.7
>> r=[1:2:11];
>> polyval(a,r)
ans = 11 89 335 845 1715 3041
>> polyval(b,r)
ans = 26 234 866 2162 4362 7706
>> polyval(c,r)
ans = 26 316 1302 3416 7090 12756
>> polyval(d,r)
ans = 24 310 1332 3570 7504 13614
B. SOLUTION TO LINEAR ALGEBRAIC EQUATIONS
1.
-4.8606
0.1803 - 0.4667i
0.1803 + 0.4667i
y=
-1.8907
-4.8606 0.18-0.47j 0.18+0.47j
-0.0546 + 0.8890i + + + 3.5
-0.0546 - 0.8890i x + 1.8907 x - (-.05+0.89j) x – (-.05-0.89)
z=
3.5000
2.
0.5000 - 0.2500i
0.5000 + 0.2500i
2.0000
Partial – fraction expansion of num / den :
y=
z=