Inverse Laplace working in command window but not in editor
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Gouri Chennuru
el 12 de Mzo. de 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 comentarios
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!