Time derivative then partial derivative of symbolic function

25 次查看(过去 30 天)
In the following code I would like to take the time derivative and then the partial derivative to x and/or y of a symbolic function.
syms x(t) y(t)
f = 4*x^3 + 3*y^2;
g = diff(f,t);
h = diff(g,x(t));
In line 4 an error tells me "Second argument must be a variable or a nonnegative integer specifying the number of differentiations."
How can I alter my code such that I can take this partial derivative?

采纳的回答

Star Strider
Star Strider 2020-10-22
Just do:
h = diff(g,x);
and it works.
  6 个评论
Lauran Leermakers
Lauran Leermakers 2020-10-22
I have succesfully upgraded to R2020b. Your suggestion works now! Thanks again

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by