%% L02_Laplace %% ============== %% Function to find laplace-transform using Matlab symbolic toolbox. %% %% Created : 15 July 2005 %% Modified : 15 July 2005 %% %% Copyright (c) 2005 Salman Durrani . %% ------------------------------------------------------------ %% clear matlab memory clear all; clc syms f b w t s %% Take Laplace Transform %% Example 1: Unit step u[n] f = heaviside(t); Ans1=maple('laplace',f,t,s) %% Example 2: f = (t^4); Ans2=maple('laplace',f,t,s) %% Example 3: f= t*sin(w*t); Ans3=maple('laplace',f,t,s) pretty(Ans3) %% Example 4: f= exp(t)*cos(w*t); Ans4=maple('laplace',f,t,s) pretty(Ans4) %% Take Inverse Laplace Transform %% Example 1: F = 1/(s^2+s); Ans1=maple('invlaplace',F,s,t) pretty(Ans1) %% Example 2: F = s/((s^2+b^2))^2; Ans2=maple('invlaplace',F,s,t) pretty(Ans2) %% Example 3: F = (3*s)/(s^2+2*s-8); Ans3=maple('invlaplace',F,s,t) pretty(Ans3)