Symbolic Toolbox: How to substitute partial derivative resulting from chain rule?
Afficher commentaires plus anciens
Consider the following:
syms f(r,s) R(x,y) S(x,y) dfdr
dfdx = diff(f(R,S), x)
which gives as ouput:
dfdx =
D([1], f)(R(x, y), S(x, y))*diff(R(x, y), x) + D([2], f)(R(x, y), S(x, y))*diff(S(x, y), x)
Now, how can I subsitute
D([1], f)(R(x, y), S(x, y))
with
dfdr
?
My attempt with
subs(dfdx, D([1], f)(R(x, y), S(x, y)), dfdr)
fails with the error message:
Error: ()-indexing must appear last in an index expression.
Any help is appreciated, thanks!
Réponses (0)
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!