how to define a variable as a function of another variable in symbolic toolbox

19 visualizaciones (últimos 30 días)
Hi I am just wondering whether is it possible to do following: define a variable as a function of x
u=f(x)
Then,
d/dx (u*x) = u'x + xu'
u' is first derivative of u w.r.t. x.
Is this possible to do using matlab symbolic toolbox?

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 5 de Oct. de 2014
syms x u
u=cos(x)
y=u*x
out=diff(y,x)
  3 comentarios
Star Strider
Star Strider el 6 de Oct. de 2014
You need to set it up correctly:
syms f(x) u(x)
ddx = diff(u*f,x)
>
ddx(x) =
D(f)(x)*u(x) + f(x)*D(u)(x)

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by