# ML7 - Matlab 8 Yikes Theres a bug Tian Gu ID 853324472 Team...

This preview shows pages 1–3. Sign up to view the full content.

1 Matlab 8 Yikes! There’s a bug! Tian Gu ID: 853324472 Team partner: Tielong Su Chaojun Zhang Matrix Mania Code A = [4, 3; 2, 1] B = [1 1; 3 8] A*B Ainv = inv(A) A*Ainv eye(2) eye(3) C = [2;3] Ainv*C Output A = 4 3 2 1 B = 1 1 3 8 ans = 13 28 5 10 Ainv = -0.5000 1.5000 1.0000 -2.0000 ans = 1 0 0 1 ans = 1 0 0 1 ans = 1 0 0 0 1 0 0 0 1 C = 2 3 ans = 3.5000 -4.0000 Discussion We changed A*B to B*A, we got the different output. ans = 13 28 5 10 ans = 6 4 28 17 But when we changed A*Ainv to Ainv*A , we got the same output. This program can get the inverse of a matrix. And eye(2) and eye(3) can help you can the

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 different sizes matrix. HW5, Problem 1 A=[-2, 3; 1, -1]; Ainv = inv(A); A*Ainv; C = [4;3]; Ainv*C; To get the the inverse of M. Then get ?? 1 . At last we can multiply C to get the equation. Code This isn’t so complex close all clear all clc aDeg = 45; aMag = 2; aRad = angle(aDeg); realPart = aMag * cos(aRad); imagPart = aMag * sin(aRad); disp('The real component is:'); disp(realPart); disp('The imag component is:'); disp(imagPart) a = 2+4*1i; real(a) imag(a) angle(a) polar(pi, 2,'*') Output 0.5 1 1.5 2 30 210 60 240 90 270 120 300 150 330 180 0
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

ML7 - Matlab 8 Yikes Theres a bug Tian Gu ID 853324472 Team...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online