clc;
clear;
f=str2sym('sin(x)');
D = deriv(f,4,3,2);
function D = deriv(f,x0,n, options)
syms x;
if options==1
fun=diff(f,n);
D=subs(fun,x0);
else
D=subs(f,x0);
for i=1:n
fun=diff(f,i);
num=subs(fun,x0);
D=[D,num];
end
end
end
符号函数求定点的导数值
最新推荐文章于 2024-09-06 12:51:13 发布