Matlab:评估二阶导数

Matlab: evaluate second derivative

在我对函数f

求二阶偏导后
second_div = diff(f,pz,2);

second_div 现在应该是 pzu

的函数

我想在给定 (pz,u) 处评估 second_div。我该怎么做?


尝试次数


second_div(2,3); <- failed because second_div is a 1*1 sym
vpa(subs(second_div,pz,u_m,2,3)); <- failed
vpa(subs(second_div,(pz,u_m),(2,3))); <- failed

谢谢。

mathworks.com/help/symbolic/subs.html 中看到您替换了 {} 中的变量列表:

syms f pz u
f = u*pz^3
second_div = diff(f,pz,2);
subs(second_div,{pz,u},[3,4])

如预期的那样给出 72