Inverse Laplace working in command window but not in editor
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there, I am writing a script to solve laplace and inverse laplace functions. When I call the inverse laplace function in the command window, it works fine. However, when I call it in the script itself, it does not seem to work. Anyone have any ideas? Below is my code.
Script code:
%---- Inverse Laplace Solver ----%
%------------DOESN'T WORK--------%
clear all
prompt = "What do you not want to do?:";
f = input(prompt);
syms s t
ilaplace(f)
Command window code:
>> ilaplace(1/(s-4))
ans =
exp(4*t)
0 Kommentare
Antworten (1)
Gouri Chennuru
am 12 Mär. 2020
Change the script code to
clear all
syms s t
prompt = "What do you not want to do?:";
f = input(prompt);
ilaplace(f)
f is an input to the “ilaplace” function and this input should be specified as a symbolic expression, symbolic function, symbolic vector or symbolic matrix.
clear all at the beginning will clear the entire workspace and before you take the input f from the user the independent variable s and Transformation variable t should be defined.
Hope this helps!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!