Calculate the Laplace Transform using Matlab/Octave
Calculating the Laplace Transform of a function ft is quite simple in Matlab. First, you need to specify that the variables t and s are symbolic ones. This is done with the command:
>> sym('t','s')
Next, you define the function f(t). The actual command to calculate the transform is:
>> F = laplace(f(t))
Here is an example for the function f(t): f(t) = -1.25 + 3.5t + e^(1.25-2t) + 1.25e^(-2t)
>> F = laplace(f(t))
F = -5/4 + 7/21s + 22 + 5/4/(s+2)
Alternatively, one can write the function f(t) directly as part of the Laplace command.
Calculating the Laplace Transform of a function ft by using Octave:
>> pkg load symbolic
Next, you define the function f1. The actual command to calculate the transform is:
>> F = laplace(f1(t))