作业帮 > 综合 > 作业

matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 7

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/14 09:30:30
matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 78 -75 4 为什么得导数?
matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 7
help sym/diff.m
DIFF Differentiate.
DIFF(S) differentiates a symbolic expression S with respect to its
free variable as determined by FINDSYM.
DIFF(S,'v') or DIFF(S,sym('v')) differentiates S with respect to v.
DIFF(S,n),for a positive integer n,differentiates S n times.
DIFF(S,'v',n) and DIFF(S,n,'v') are also acceptable.
Examples;
x = sym('x');
t = sym('t');
diff(sin(x^2)) is 2*cos(x^2)*x
diff(t^6,6) is 720.
See also INT,JACOBIAN,FINDSYM.
这个才是求导的函数,输入必须是sym
你用的那个,输入是数组,是求差分用的,是先将字符串转换成ASCII码,然后求的ASCII码的差.