How to get symbolic output notation, exp(1)=e?

Hi!
Im trying to using symbolic ODE-solver
syms u(x);
sympref('FloatingPointOutput',false);
Du=diff(u);
ode=diff(u,x,2)==4*u
cond1=u(0)==0
cond2=Du(1)==exp(2)-exp(-2)
conds=[cond1 cond2];
uSol(x)=dsolve(ode,conds)
uSol = simplify(uSol)
But the output comes in the form of
which I would prefer to be presented in the form of
Any suggestions how to do this?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 14 de Nov. de 2020
Editada: Walter Roberson el 14 de Nov. de 2020
syms u(x);
sympref('FloatingPointOutput',false);
Du=diff(u);
ode=diff(u,x,2)==4*u
ode(x) = 
cond1=u(0)==0
cond1 = 
cond2=Du(1)==exp(sym(2))-exp(sym(-2))
cond2 = 
conds=[cond1 cond2];
uSol(x)=dsolve(ode,conds)
uSol(x) = 
uSol = simplify(uSol)
uSol(x) = 

2 comentarios

Anders Nordlöf
Anders Nordlöf el 14 de Nov. de 2020
Thanks for your quick response!
I'm almost there...
Just want to have the final expression fully simplyfied like yours. Do you know any further magic commands?
Anders Nordlöf
Anders Nordlöf el 14 de Nov. de 2020
Nvm..Google gave it to me =)
Once again, huge thanks Walter!!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Nov. de 2020

Comentada:

el 14 de Nov. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by