Lecture_F11_ECH157_Useful_MATLAB_Commands

Lecture_F11_ECH157_Useful_MATLAB_Commands - Useful MATLAB...

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

Useful MATLAB Commands Using MATLAB for symbolic processing (using the “syms” command) >> syms a x y z t k s Note: a x y z t k s are symbolic objects. Laplace Transform >> laplace (exp(-a*t)) ans =1/(s+a) >> laplace (t) ans =1/s^2 >> laplace (sin(k*t)) ans =k/(s^2+k^2) Inversion of Laplace Transform (the command “ilaplace”) >> x=ilaplace(2/s/(s^3+4*s^2+5*s+2)) x =-exp(-2*t)-2*t*exp(-t)+1 >> ilaplace(0.5/(s+1/10)) ans = 1/(2*exp(t/10)) Using MATLAB to find the roots of polynomial equation (S 4 + 6S 2 + 11S + 6): “roots” command

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

View Full Document
» n=[1 0 6 11 6] » roots (n) Note: vector n contains coefficients of the polynomial equation Partial fractions (the command “diff(int(…))”; make the answer looks pretty) >> x=(s^4-6*s^2+9*s-8)/s/(s-2)/(s+1)/(s+2)/(s-1) >> diff(int(x)) ans =1/12/(s-2)+11/3/(s+1)-17/12/(s+2)-2/s+2/3/(s-1) >> pretty (ans) Note: “pretty” function makes the equation looks “pretty” in MATLAB window. Solve symbolic solution of algebraic equations (“solve”)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

Lecture_F11_ECH157_Useful_MATLAB_Commands - Useful MATLAB...

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

View Full Document
Ask a homework question - tutors are online