Lec 09. Symbolic Math Toolbox II

Download Lec 09. Symbolic Math Toolbox II

Post on 15-Jun-2015

608 views

Category:

Education

10 download

Embed Size (px)

TRANSCRIPT

<ul><li> 1. MATLAB ProgrammingSymbolic Math Toolbox II kmste2@kaist.ac.kr1</li></ul><p> 2. MATLAB Programming (polynomial) = 1 + 2 1 + + + +1 , MATLAB = 1, 2 , , +1 pi y = polyval( P, X ) = 3 2 2 + 1 P X evaluate () at = 5&gt;&gt; p = [3 -2 1]; &gt;&gt; polyval(p,5) ans = 66 2 3. MATLAB ProgrammingMATLAB = 3 6 3 4 2 x 5, 3, 2, 1 , MATLAB 0 P = [3 0 -3 0 0 -2 0] &gt;&gt; P = [3 0 -3 0 0 -2 0]; &gt;&gt; polyval(P, 0) ans = 0 &gt;&gt; polyval(P, 1) ans = -23 4. MATLAB Programming = 3 6 3 4 2 Y = polyval( P, X) , X , , Y X P = [3 0 -3 0 0 -2 0] &gt;&gt; polyval(P, magic(2))&gt;&gt; polyval(P, [0 -3 2])ans =ans = 01950140-2 115121938 1404 5. MATLAB ProgrammingQuiz x = 0:2:6 . = 3 2 7 2 + 2 + 23 = 4 3 0.53 4 = 3 2 4 25 6. MATLAB Programming = 3 100 3 90 + 5 23 3 3 2 , ? , 1001 P P = [3 0 0 0 0 0 0 0 0 0 -3 0 0 0 0 0 0 -3 0 -2 0] ! Symbolic Math Toolbox !! P = sym2poly( F ) (symbolic polynomial) polynomial coefficient vector &gt;&gt; syms x &gt;&gt; f = 3*x^100 - 3*x^90 + 5*x^23 - 3*x^3 - 2*x; &gt;&gt; P = sym2poly(f) 6 7. MATLAB Programming ? Symbolic Math Toolbox !! F = poly2sym( P ) polynomial coefficient vector P = [3 1 -1 0 -5 0] &gt;&gt; P = [3 1 -1 0 -5 0]; &gt;&gt; poly2sym(P) ans = 3*x^5 + x^4 - x^3 - 5*x7 8. MATLAB Programming convolution C = conv( A, B ) = 4 3 2 + 1 = 3 3 + 5 2 3 2 G = [3 5 -3 -2] 1-204 35-335-3-235-3-235-3-235-3-23 3 F = [4 0 -2 1]5-3-25-3-2-24 x 3 = 12 0 x 3 + 4 x 5 = 20 -2 x 3 + 0 x 5 + 4 x -3 = -18 1 x 3 + -2 x 5 + 0 x -3 + 4 x -2 = -15&gt;&gt; F = [4 0 -2 1]; &gt;&gt; G = [3 5 -3 -2]; &gt;&gt; conv(F,G) ans =1 x 5 + -2 x -3 + 0 x -2 = 11 1 x -3 + -2 x -2 = 11220 -18 -15111-21 x -2 = -28 9. MATLAB Programming Convolution 1. symbolic polynomial 2. symbolic polynomial 3. sym2poly polynomial coefficient vector &gt;&gt; F = [4 0 -2 1]; &gt;&gt; G = [3 5 -3 -2]; &gt;&gt; fn = expand( poly2sym(F) * poly2sym(G) ) fn = 12*x^6 + 20*x^5 - 18*x^4 - 15*x^3 + 11*x^2 + x 2 &gt;&gt; sym2poly(fn) ans = 12 20 -18 -15111-2 9 10. MATLAB Programming , = 2 2 + 1 = 3 2 2 2 = + 1&gt;&gt; A = poly2sym([2 -1 1]); &gt;&gt; B = poly2sym([1 -2 0 -2]); &gt;&gt; C = poly2sym([1 1]); &gt;&gt; D = A*B*C&gt;&gt; A = [2 -1 1]; &gt;&gt; B = [1 -2 0 -2]; &gt;&gt; C = [1 1]; &gt;&gt; D = conv(conv(A,B),C)D= -(x + 1)*(2*x^2 - x + 1)*(- x^3 + 2*x^2 + 2)D= &gt;&gt; sym2poly(D) 2-3-2-3-40-2 ans = 2 -3-2-3-40-2 10 11. MATLAB Programming = + () () () g h [q, r] = deconv( g, h ) g h , q r (q, r ) = 3 6 2 + 12 8 = 2&gt;&gt; g = [1 -6 12 -8]; &gt;&gt; h = [1 -2]; &gt;&gt; [q, r] = deconv(g,h) q= 1-4400r= 0011 12. MATLAB ProgrammingQuiz g h symbolic expression . = 3 6 2 + 12 8 = 2 symbolic expression , . = 3 6 2 + 12 8 = 1: 1 12 13. MATLAB ProgrammingQuiz Sol. g h symbolic expression . = 3 6 2 + 12 8 = 2&gt;&gt; g = [1 -6 12 -8]; &gt;&gt; h = [1 -2]; &gt;&gt; sg = poly2sym(g); sh = poly2sym(h); &gt;&gt; sg/sh ans = (x^3 - 6*x^2 + 12*x - 8)/(x - 2) &gt;&gt; simplify(sg/sh) ans = (x - 2)^2 &gt;&gt; expand(simplify(sg/sh)) ans = x^2 - 4*x + 4 13 14. MATLAB ProgrammingQuiz Sol. symbolic expression , . = 3 6 2 + 12 8 = 1&gt;&gt; g = [1 -6 12 -8]; &gt;&gt; h = [1 -1]; &gt;&gt; sg = poly2sym(g); sh = poly2sym(h); &gt;&gt; sg/sh ans = (x^3 - 6*x^2 + 12*x - 8)/(x - 1) &gt;&gt; simplify(sg/sh) ans = (x - 2)^3/(x - 1) ?? 14 15. MATLAB ProgrammingSymbolic [Q, R] = quorem( F, G ) F G F/G , Q, R = 3 6 2 + 12 8 = 1&gt;&gt; g = [1 -6 12 -8]; &gt;&gt; h = [1 -1]; &gt;&gt; sg = poly2sym(g); sh = poly2sym(h); &gt;&gt; [q, r] = quorem(sg, sh) q= x^2 - 5*x + 7 r= -1 % &gt;&gt; expand(q*sh+r) ans = x^3 - 6*x^2 + 12*x - 815 16. MATLAB Programming sym/coeffs [c, terms] = coeffs( P ) P c , terms &gt;&gt; syms x y &gt;&gt; z = 3*x^2*y^2 + 5*x*y^3 &gt;&gt; [c, terms] = coeffs(z) c= [ 3, 5] terms = [ x^2*y^2, x*y^3]&gt;&gt; syms x y &gt;&gt; z = 3*x^2*y^2 + 5*x*y^3 &gt;&gt; [c, terms] = coeffs(z, x) [c, terms] = coeffs( P, X ) P X c , terms c= [ 3*y^2, 5*y^3] terms = [ x^2, x] &gt;&gt; [c, terms] = coeffs(z, y) c= [ 5*x, 3*x^2] terms = [ y^3, y^2]16 17. MATLAB Programming [N, D] = numden( A ) A N (numerator), D (denominator) &gt;&gt; sym x y &gt;&gt; r = 1 + x^2 / (3 + x^2/5); r= x^2/(x^2/5 + 3) + 1 &gt;&gt; [n, d] = numden( r ) n= 6*x^2 + 15 d= x^2 + 15&gt;&gt; [n,d] = numden(sym(4/5)) n= 4 d= 5 &gt;&gt; [n,d] = numden(x/y + y/x) n= x^2 + y^2 d= x*y17 18. MATLAB ProgrammingTaylor F = taylor( A ) A , F 0 Taylor 5 &gt;&gt; syms x y z &gt;&gt; f = taylor(log(1+x)) f= x^5/5 - x^4/4 + x^3/3 - x^2/2 + x &gt;&gt; ezplot( 'log(1+x)' ) &gt;&gt; hold on; &gt;&gt; h = ezplot( f ); &gt;&gt; set(h, 'color', 'red');18 19. MATLAB ProgrammingTaylor F = taylor( A, x, a, order, n ) A x = a n % sin(x) x=0 &gt;&gt; syms x; &gt;&gt; f = taylor(sin(x), x, 0, 'order', 10) f= x^9/362880 - x^7/5040 + x^5/120 - x^3/6 + x &gt;&gt; ezplot( 'sin(x)' ); &gt;&gt; hold on; &gt;&gt; h = ezplot( f ); &gt;&gt; set( h, 'color', 'red' );19 20. MATLAB ProgrammingTaylor F = taylor( A, x, a, order, n ) A x = a n % sin(x) x=2 &gt;&gt; syms x; &gt;&gt; f = taylor(sin(x), x, 2, 'order', 10) f= x^9/362880 - x^7/5040 + x^5/120 - x^3/6 + x &gt;&gt; ezplot( 'sin(x)' ); &gt;&gt; hold on; &gt;&gt; h = ezplot( f ); &gt;&gt; set( h, 'color', 'red' ); &gt;&gt; ylim( [-5 5] )20 21. MATLAB ProgrammingMultivariable Taylor F = taylor( A, [x1, x2, , xk] , [a1, a2, , ak], order, n ) A (x1, x2, , xk) = (a1, a2, ..., ak) n % 2 (x,y) = (0, 0) &gt;&gt; syms x y; &gt;&gt; f = x + y + 3*exp(-x^2-y^2); &gt;&gt; ezsurf(f, [-1 2]); &gt;&gt; g = taylor(f, [x,y], [0,0], 'order', 10); &gt;&gt; hold on; &gt;&gt; ezsurf(g, [-1 2]);21 22. MATLAB ProgrammingParametric Taylor = 20cos , = 20sin , = , Taylor , x(t), y(t), z(t) t syms x y t x = exp(-t/20)*cos(t); y = exp(-t/20)*sin(t); z = t; figure(1); ezplot3(x,y,z, [-10 10]); p = [x y z]; f = taylor(p, t, 0, 'order', 30); figure(2); ezplot3(f(1), f(2), f(3), [-10, 10]); 22 23. MATLAB Programming 23 24. MATLAB ProgrammingSymbolic Equation Solver solve solve( eqn1, eqn2, , eqnN) solve( eqn1, eqn2, , eqnN, var1, var2, , varN) var 2 + + = 0 &gt;&gt; syms a b c x &gt;&gt; f = a*x^2+b*x+c; &gt;&gt; solve(f) f==0 ans = -(b + (b^2 - 4*a*c)^(1/2))/(2*a) -(b - (b^2 - 4*a*c)^(1/2))/(2*a) 2 4 22 24 25. MATLAB ProgrammingSymbolic Equation Solver eg) 2 2 4 = 0solve solve , symbolic , . &gt;&gt; syms x &gt;&gt; f = x^2-2*x-4; &gt;&gt; solve(f==0, x) ans = 5^(1/2) + 1 1 - 5^(1/2)&gt;&gt; solve('x^2-2*x-4==0')ans = 5^(1/2) + 1 1 - 5^(1/2)25 26. MATLAB ProgrammingSymbolic Equation Solver = () , , f(x) = g(x) , symbolic eg) cos 2 = 1 sin() , f(x) g(x) == 0 .&gt;&gt; syms x &gt;&gt; f = cos(2*x) + sin(x) - 1&gt;&gt; solve('cos(2*x) = 1 - sin(x)') ans = 0 pi/6 (5*pi)/6f= cos(2*x) + sin(x) - 1 &gt;&gt; solve(f) ans = 0 pi/6 (5*pi)/6 26 27. MATLAB Programming , 2 log = 1 , &gt;&gt; syms x y &gt;&gt; f = 2*x-log(y)-1&gt;&gt; solve('2*x-log(y)=1', 'x') f= 2*x - log(y) - 1ans =&gt;&gt; solve(f, x)log(y)/2 + 1/2ans = log(y)/2 + 1/2&gt;&gt; solve('2*x-log(y)=1', 'y') ans =&gt;&gt; solve(f, y) exp(2*x - 1) ans = exp(2*x - 1)27 28. MATLAB Programming , 2 = 2 y 2 = 5 , 1. , (y ) = 2 2 , 2 = 2 + 5 2. , 2 2 = 2 + 5 3. (x ) = 1 2 2 4. 3 = 7 + 4 2, = 7 4 228 29. MATLAB Programming , 2 = 2 y 2 = 5 ,&gt;&gt; simplify(subs(y1, xsols)) &gt;&gt; syms x &gt;&gt; y1 = x^2 - 2; &gt;&gt; y2 = 2*x + 5; &gt;&gt; xsols = solve(y1 == y2)ans =xsols =&gt;&gt; simplify(subs(y2, xsols))2*2^(1/2) + 1 1 - 2*2^(1/2)ans =4*2^(1/2) + 7 7 - 4*2^(1/2)4*2^(1/2) + 7 7 - 4*2^(1/2)29 30. MATLAB Programming 2 = 2 y 2 = 5 solve % % &gt;&gt; sols.x(1)&gt;&gt; sols.x(2)&gt;&gt; syms x y &gt;&gt; sols = solve( x^2 - y == 2, y - 2*x == 5 )ans =ans =sols =2*2^(1/2) + 11 - 2*2^(1/2)&gt;&gt; sols.y(1)&gt;&gt; sols.y(2)ans =ans =4*2^(1/2) + 77 - 4*2^(1/2)x: [2x1 sym] y: [2x1 sym]30 31. MATLAB ProgrammingQuiz solve . + = 0 3 + 2 = 5 2 3 = 6 = 32 = 5 + 11 + 22 + 43 34 = 5 21 + 32 3 64 = 2 1 + 52 33 + 24 = 4 1 32 53 = 131 32. MATLAB ProgrammingQuiz Sol. % problem 1 &gt;&gt; syms x y z &gt;&gt; f1 = x + y - z == 0; &gt;&gt; f2 = 3*x + 2*y - z == 5; &gt;&gt; f3 = 2*x - y - 3*z == -6; &gt;&gt; sols = solve(f1, f2, f3)% problem 2 &gt;&gt; syms x y &gt;&gt; sols = solve('y=3^(2*x)', 'y=5^x+1')sols = sols = solve . x: [1x1 sym] + = 0 3 + 2 = 5 2 3 = 6 = 3 = 5 + 1 21 + 22 + 43 34 = 5 21 + 32 3 64 = 2 1 + 52 33 + 24 = 4 1 32 53 = 1y: [1x1 sym] z: [1x1 sym]x: [1x1 sym] y: [1x1 sym]&gt;&gt; [sols.x sols.y sols.z]&gt;&gt; [sols.x sols.y]ans = [ 2, 1, 3]ans =[ 0.57107246071180090433600366899982, 3. &gt;&gt; digits(5) &gt;&gt; [sols.x sols.y] % problem 3 &gt;&gt; syms x1 x2 x3 x4 &gt;&gt; f1 = x1+2*x2+4*x3-3*x4 == 5; &gt;&gt; f2 = -2*x1+3*x2-x3-6*x4 == 2; &gt;&gt; f3 = x1+5*x2-3*x3+2*x4 == 4; &gt;&gt; f4 = x1-3*x2-5*x3==1; &gt;&gt; sols = solve(f1,f2,f3,f4) sols = x1: [1x1 sym] x2: [1x1 sym] x3: [1x1 sym] x4: [1x1 sym] &gt;&gt; [sols.x1 sols.x2 sols.x3 sols.x4] ans = [ 720/337, 397/674, -85/674, -246/337]32 33. MATLAB ProgrammingQuiz , = 4 2 + 3 f(x,y) g(x,y) . , = 2 4+ 2 133 34. MATLAB ProgrammingQuiz Sol. , = 4 2 + 3 f(x,y) g(x,y) . , = 2 4+ 2 1% solution syms x y f = y - 4*x^2+3; g = x^2/4 + y^2 - 1; h1 = ezplot(g); set(h1, 'color', 'r'); hold on; h2 = ezplot(f); set(h2, 'color', 'b'); grid on; axis([-3 3 -4 4]);[xs, ys] = solve(f, g) sols = [double(xs) double(ys)] 34 35. MATLAB ProgrammingQuiz , x, y = 0 cos(). = 0 sin 1 2 2 v0 100 m/s , g 9.8 m/s2 , .35 36. MATLAB ProgrammingQuiz Sol. disty(t) 0 t , disty(t) 0 , t . syms v0 t theta g disty = v0 * t * sin(theta) - 1/2 * g * t^2; distx = v0 * t * cos(theta) impact_time = solve(disty, t, 0)impact_time = 0 (2*v0*sin(theta))/g36 37. MATLAB ProgrammingQuiz Sol. disty(t) 0 , t distx t , distx theta impact_dist = subs(distx, t, impact_time(2)); g = 9.8; v0 = 100; impact_dist = subs(impact_dist)impact_dist = (100000*cos(theta)*sin(theta))/4937 38. MATLAB ProgrammingQuiz Sol. distx(theta) theta = 0 .. pi/2 plot t = 0:0.1:pi/2; y = subs(impact_dist, theta, t); plot(t, y) grid on38 39. MATLAB Programmingfzero solve f(x) = sin(x) 0.5x 0 , 2 &gt;&gt; syms x &gt;&gt; ezplot('sin(x) - 0.5*x') &gt;&gt; grid onfzero f (, f(x) = 0) 2 1016 x* x0 ,39 40. MATLAB Programmingfzero solve f(x) = sin(x) 0.5x 0 , 2 &gt;&gt; solve('sin(x)-0.5*x==0') ans = 0 &gt;&gt; fzero('sin(x)-0.5*x', [1 3]) ans = 1.8955 &gt;&gt; fzero('sin(x)-0.5*x', [-3 -1]) ans = -1.8955 &gt;&gt; fzero('sin(x)-0.5*x', [-5 -3]) Error using fzero (line 274) The function values at the interval endpoints must differ in sign.40 41. MATLAB ProgrammingQuiz fzero . x tan(x) = 0 cos(x) x = 041 42. MATLAB ProgrammingQuiz Sol. fzero . x tan(x) = 0&gt;&gt; solve('x - tan(x) == 0') ans = 0 &gt;&gt; ezplot('x - tan(x)') &gt;&gt; grid on &gt;&gt; fzero('x - tan(x)', -4) ans = -4.4934 cos(x) x = 0&gt;&gt; fzero('x - tan(x)', 4) ans = 4.493442 43. MATLAB Programming roots p z = roots( p ) p z p = 0 &gt;&gt; syms x &gt;&gt; p = sym2poly(x^2 - x - 1) p= 1-1-1&gt;&gt; z = roots(p) z= -0.6180 1.618043 44. MATLAB Programming polyval p v = polyval( p, z ) p z % &gt;&gt; syms x &gt;&gt; p = sym2poly(x^2 - x - 1) p= 1-1-1&gt;&gt; z = roots(p) z= -0.6180 1.6180% &gt;&gt; polyval(p, z) ans = 1.0e-15 * -0.1110 0.22200 44 45. MATLAB Programming 45 46. MATLAB Programming MATLAB D, 2 2 D2, 3 3 D3, , Dn D = 2 Dy = -2xy = 2, y 1 = 1&gt;&gt; dsolve('Dy = -2*x*y', 'y(1) = 1', 'x') ans = exp(1)*exp(-x^2) 46 47. MATLAB ProgrammingSymbolic Expression Symbolic Math D D, 2 2 D2, 3 3 D3, , diff(x) Dn = 2, y 1 = 1&gt;&gt; syms x y(t) &gt;&gt; dsolve(diff(y) == -2*x*y, y(1) == 1, x) ans = exp(1)*exp(-x^2)47 48. MATLAB Programmingn + 6 + 9 = 0, y 0 = 4, y 0 = 14 y 2 2 D2y, y Dy &gt;&gt; Dsol = dsolve('D2y+6*Dy+9*y=0', 'y(0)=-4', 'Dy(0)=14', 'x') Dsol = 2*x*exp(-3*x) - 4*exp(-3*x) &gt;&gt; simple(Dsol) ans = 2*exp(-3*x)*(x - 2)48 49. MATLAB Programmingn + 6 + 9 = 0, y 0 = 4, y 0 = 14 y 2 2 D2y, y Dy symbolic expression &gt;&gt; syms x y(t) &gt;&gt; D2y = diff(diff(y)); &gt;&gt; Dy = diff(y); &gt;&gt; Dsol = dsolve(D2y+6*Dy+9*y==0, y(0)==-4, Dy(0)==14, x) Dsol = 2*x*exp(-3*x) - 4*exp(-3*x)49 50. MATLAB Programming (D = ) 2 3 = 2 2 2 1 ,x 0 = ,y 0 = 3 3 + 4 = 3 2 x Dx, y Dy &gt;&gt; DSol2 = dsolve('Dx-2*x-3*y=2*exp(2*t)', '-x+Dy-4*y=3*exp(2*t)', 'x(0)=-2/3', 'y(0)=1/3') DSol2 = y: [1x1 sym] x: [1x1 sym] &gt;&gt; DSol2.x ans = - (3*exp(2*t))/4 - exp(5*t)*((11*exp(-3*t))/12 - 1) &gt;&gt; DSol2.y ans = exp(2*t)/4 - exp(5*t)*((11*exp(-3*t))/12 - 1)50 51. MATLAB Programming (D = ) Symbolic Expression 2 3 = 2 2 2 1 ,x 0 = ,y 0 = 3 3 + 4 = 3 2 x Dx, y Dy syms x y x(t) y(t) Dx = diff(x); Dy = diff(y); deq1 = Dx-2*x-3*y==2*exp(2*t); deq2 = -x+Dy-4*y==3*exp(2*t); DSol2 = dsolve(deq1, deq2, 'x(0)=-2/3', 'y(0)=1/3', t);51 52. MATLAB ProgrammingQuiz symbolic expression = = 2 + 2 ( + 1) = 1 , +12 1 2=0(0) = 152 53. MATLAB ProgrammingQuiz Sol. symbolic expression = = 2syms x y(t) Dy = diff(y); dsolve(Dy==exp(x)/(2*y)) + 2 ( + 1) = 1 , +12 1 2=0syms x y(t) Dy = diff(y); dsolve(Dy==(exp(y)*x)/(exp(y)+x^2*exp(y)))(0) = 1syms x(t) Dx = diff(x); f = exp(x)*(Dx+1)==1; dsolve(f, x(0)==1) syms x y(t) Dy = diff(y); f = Dy + sqrt((1-y^2)/(1-x^2)) == 0; dsolve(f)53 54. MATLAB Programming54 55. MATLAB Programming? f(t) F(s) . f(t) F(s) . . , , 1. f(t) F(s) ( ) 2. F(s) 3. F(s) f(t) Laplace , Z-, Fourier , 55 56. MATLAB ProgrammingLaplace : = : == 0+ 1 2 % &gt;&gt; syms t w &gt;&gt; laplace(t^2)% &gt;&gt; syms s w &gt;&gt; ilaplace( 1/s^3 )ans = 2/s^3ans = t^2/2&gt;&gt; laplace(cos(w*t))&gt;&gt; ilaplace( 3/(s+w) )ans = s/(s^2 + w^2)ans = 3*exp(-t*w)&gt;&gt; laplace(t^1)&gt;&gt; ilaplace( s/(s^2+4) )ans = 1/s^2ans = cos(2*t) 56 57. MATLAB ProgrammingLaplace (1/2) = 0 1 2 Laplace 2 2= 2 (0) + 6 + 9 = 0, y 0 = 4, y 0 = 14 Laplace + 6 + 9 = + 6 + 9 = 2 0 + 6 6 0 + 9 = 0 2 + 6 + 9 = 4 + 14 =4+14 2 +6+957 58. MATLAB ProgrammingLaplace (2/2) =4+14 2 +6+9 F(s) &gt;&gt; syms s &gt;&gt; Y = (-4*s+14)/(s^2+6*s+9) Y= -(4*s - 14)/(s^2 + 6*s + 9) &gt;&gt; ilaplace(Y) ans = 26*t*exp(-3*t) - 4*exp(-3*t) 58 59. MATLAB ProgrammingZ Z : = % Z &gt;&gt; syms t &gt;&gt; f = sin(2*t)= =0% Z &gt;&gt; syms z &gt;&gt; f = 3*z/(z^2 - 4*z + 5); &gt;&gt; f = 3*z/(z^2 - 4*z + 5) f= (3*z)/(z^2 - 4*z + 5) &gt;&gt; ft = iztrans(f) =3 2 4 + 5f= sin(2*t)ft = ((-1)^n*(- 2 - i)^(n - 1)*15*i)/4 - ((-1)^n*(- 2 + i)^(n - 1)*15*i)/4 + (3*(-1)^n*5^n*cos(n*(pi - a&gt;&gt; fz = ztrans(f)&gt;&gt; pretty(ft)fz = (z*sin(2))/(z^2 - 2*cos(2)*z + 1) &gt;&gt; pretty(fz) z sin(2) ------------------2 z - 2 cos(2) z + 1/ / / 1/2n n | | |25 ||| 3 (-1) 5 cos| n | pi - acos| ------ | | | n n-15 / / / 15 (-1) (i - 2) i ------------------------------------------- - ----------------------- + 1/2 n 4 2 (5 ) n n-1 15 (-1) (- i - 2) i ------------------------459 60. MATLAB ProgrammingFourier Fourier : = Fourier : = % Fourier &gt;&gt; syms x u &gt;&gt; f = x*exp(-abs(x)) f= x*exp(-abs(x))1 2 = ||% Fourier &gt;&gt; syms x &gt;&gt; f = exp(-abs(x)) = ||f= exp(-abs(x))&gt;&gt; g = fourier(f, u) &gt;&gt; g = ifo...</p>