Professional Documents
Culture Documents
SNS Lab11 SP2020
SNS Lab11 SP2020
(EL-223)
LABORATORY MANUAL
(LAB # 11)
FINDING LAPLACE TRANSFORM OF SINGLE-SIDED AND TWO-SIDED
SIGNALS USING MATLAB
Verified by: Dr. Waqas bin Abbas, Dr. Shahzad Updated: Spring 2020
Saleem
Finding Single Sided And Two Sided Signals Laplace Transform Using MATLAB Lab 11
Description:
MATLAB provides command for working with transforms, such as the Laplace and Fourier transforms.
Transforms are used in science and engineering as a tool for simplifying analysis and look at data from
another angle.
For example, laplace transform allows us to convert a differential equation to an algebraic equation.
MATLAB provides the laplace command to work with Laplace transform.
MATLAB allows us to compute the Laplace transform using the command laplace.
Example:
Code Command Window Output
syms t ans = 1/s^2
laplace(t)
Similarly, we can compute the inverse Laplace transform using the command ilaplace.
Example:
Code Command Window Output
syms s ans = t
ilaplace(1/s^2)
PRACTICE TASK:
Compute the Laplace transform of following commonly used functions.
𝑥(𝑡) = 𝑡 2
𝑥(𝑡) = 𝑒 −𝑏𝑡
𝑥(𝑡) = cos(𝜔0 𝑡))
PRACTICE TASK:
Compute the inverse Laplace transform of given signals:
Very Useful symbolic commands for basic manipulations: Try this in Matlab
clc;clear;close all
% Expand a polynomial, make it look nice, solve it, and check the
solution.
syms x a % tell Matlab that x and a are symbols
f = (x-1)*(x+a)*(x+pi)*(x+2)*(x+3); % define function f
pretty(f) % print f in more readable form
g = expand(f) % re-write f, multiply everything out
fact = factor(g) % factorize given polynomial in nice way
h = collect(g) % re-write again by collecting terms
soln = solve(h,x) % find all solutions by letting h = 0
check = subs(f,x,soln(5)) % check say the 5th solution satisfy the
function or not