Unformatted text preview:

1. Code a = complex ( 3,-3) real = real(a) imag = imag(a) Output a = 3.0000 - 3.0000i real = 3 imag = -3 2. Code a = complex ( 4,1) conjugate = conj(a) Output a = 4.0000 + 1.0000i conjugate = 4.0000 - 1.0000i 3. Code a = complex(-1/2,1/5) Mag = abs(a) angle = angle(a) output a = -0.5000 + 0.2000i Mag = 0.5385 angle = 2.7611 4. Code a = complex(0,-2)*exp(complex(0,1)*(pi/12)) output a = 0.5176 - 1.9319i5. Code a = complex(12,-3) mag = abs(a) output a = 12.0000 - 3.0000i mag = 12.3693 6. Code a = complex(-2/(3)^.5,(2/3)^.5) phase = acos(real(a)/abs(a)) output a = -1.1547 + 0.8165i phase = 2.5261 7. Code a = complex(-3,2) inverse = inv(a) output a = -3.0000 + 2.0000i inverse = -0.2308 - 0.1538i 8. code a = complex(1,1) b = complex(2,-1) ratio = a/b output a = 1.0000 + 1.0000i b = 2.0000 - 1.0000i ratio = 0.2000 + 0.6000i9. code syms S [a,s] = residue([1, 1], [1, 3, 2]) Term1 = a(1)/(S-s(1)) Term2 = a(2)/(S-s(2)) Output a = 1 0 s = -2 -1 Term1 = 1/(S + 2) Term2 = 0 10. code a = [6 -.5 .5 -1] Determinant = det(a) Output a = 6.0000 -0.5000 0.5000 -1.0000 Determinant = -5.7500 11. code a = [2 18 -2/3 -6] Nullvector = null(a) Output a = 2.0000 18.0000 -0.6667 -6.0000 Nullvector = 0.9939 -0.110412. code a = [-9 5 -24 11] Eigenvalues = eig(a) Output a = -9 5 -24 11 Eigenvalues = 1.0000 + 4.4721i 1.0000 - 4.4721i 13. code a = [9 1 -5 15] [v, ~] = eig(a) [w, ~] = eig(a') output a = 9 1 -5 15 v = -0.7071 -0.1961 -0.7071 -0.9806 w = -0.9806 0.7071 0.1961 -0.7071 14. code t = 0:2*pi/100:2*pi plot(real(exp(cos(4*t)+complex(0,t))),imag(exp(cos(4*t)+complex(0,t)))) grid on title('Plot of {exp^(cos(4*t)+j*t)}') xlabel('\Re') ylabel('\Im') output15. code om = -10:0.1:10; semilogx(om, 1./sqrt(om.^4-5*om.^2+9), 'r') grid on title('Plot of magnitude of {H(j\omega)=1/(j\omega^4-5*j\omega^2 +9)}') xlabel('\omega') output16. code [re, im] = meshgrid(-0.99:0.01:-0.5,-0.5:0.01:0.5); mag = abs(2*re./exp(abs(complex(re,im)))) contour(re, im, mag, 100) grid on xlabel('\Re(s)') ylabel('\Im(s)') output17. code [re, im] = meshgrid(-0.99:0.01:-0.5,-0.5:0.01:0.5); s= complex(re,im) mag = i*(s-conj(s)).*exp(-abs(s)) grid on surface(re, im, mag, 'EdgeColor', [0.8 0.8 0.8],'FaceColor', 'r') view(-45,45) title('Surface plot of {j(s - conjugate(s))/e^|s|}') xlabel('\Re(s)') ylabel('\Im(s)')


View Full Document

UIUC ME 340 - Lab 1

Documents in this Course
Load more
Download Lab 1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?