Consider the two matrices: A = [2 2pi 6j 5 + Squareroot 2 j]; B = [6j -13 pi 2 p
ID: 2079248 • Letter: C
Question
Consider the two matrices: A = [2 2pi 6j 5 + Squareroot 2 j]; B = [6j -13 pi 2 pi 8]. Use MATLAB to compute items below: A + 2B AB + I; I is the Identity matrix. A^2 + 2B^2 - A^-1B A' (same as A^H i.e. complex conjugate transpose. For transpose use A.') B'A' B^TA^T (This is regular transpose, not complex conjugate.) Solve the following set of linear algebraic equations numerically by MATLAB, put the equations in vector matrix form and solve: 4x + 5y + 10z = 4 -3x + 15z = 10 -7y + 20z = 0. Solve the above set of equations symbolically by "solve" command. Follow below, study how it works. It is easier to copy/paste these in a new m-file. In that case, you wouldn't need to retype in case of errors. syms x y z % Define symbols x, y, z. eq1 = 4 *x + 5*y + 10*z - 4 % Move all arguments to one side. eq2 = -3*x + 15*z - 10 % So that now eq1 = eq2 = eq3 = 0. eq3 = -7*y + 20*z [xx, yy, zz] = solve (eq1, eq2, eq3, x, y, z) % Solve equations symbolically. % The answers are rational numbers (long fractions), convert to double precision numbers: xx = double (xx) yy = double (yy) zz = double (zz)Explanation / Answer
(1)
clc;
clear all;
close all;
A=[2 2*pi; 6*i 5+sqrt(2)*i]
B=[6*i -13*pi; 2*pi 8]
%(a)
a=A+2*B
%(b)
b=A*B+[1 0; 0 1]
%(c)
c=A^2+2*B^2-inv(A)*B
%(d)
d=A'
%(e)
e=B'*A'
OUTPUT
A =
2.0000 + 0.0000i 6.2832 + 0.0000i
0.0000 + 6.0000i 5.0000 + 1.4142i
B =
0.0000 + 6.0000i -40.8407 + 0.0000i
6.2832 + 0.0000i 8.0000 + 0.0000i
a =
2.0000 +12.0000i -75.3982 + 0.0000i
12.5664 + 6.0000i 21.0000 + 1.4142i
b =
1.0e+02 *
0.4048 + 0.1200i -0.3142 + 0.0000i
-0.0458 + 0.0889i 0.4100 - 2.3373i
c =
1.0e+02 *
-5.8006 + 0.3874i -6.0907 - 4.7402i
0.9168 + 1.1611i -3.5585 + 0.4956i
d =
2.0000 + 0.0000i 0.0000 - 6.0000i
6.2832 + 0.0000i 5.0000 - 1.4142i
e =
1.0e+02 *
0.3948 - 0.1200i -0.0458 - 0.0889i
-0.3142 + 0.0000i 0.4000 + 2.3373i
>>
(2)
A=[4 5 10; -3 0 15; 0 -7 20]
b=[4 10 0]
z=inv(A)*b'
OUTPUT
z =
-1.3763
1.1183
0.3914
(3)
syms x y z
eq1=4*x+5*y+10*z-4
eq2=-3*x+15*z-10
eq3=-7*y+20*z
[xx yy zz]=solve(eq1,eq2,eq3,x,y,z)
xx=double(xx)
yy=double(yy)
zz=double(zz)
OUTPUT:
eq1 =
4*x + 5*y + 10*z - 4
eq2 =
15*z - 3*x - 10
eq3 =
20*z - 7*y
xx =
-128/93
yy =
104/93
zz =
182/465
xx =
-1.3763
yy =
1.1183
zz =
0.3914