matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 78 -75 4 为什么得导数?
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/30 21:05:59
![matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 78 -75 4 为什么得导数?](/uploads/image/z/3764199-39-9.jpg?t=matlab%E4%B8%AD%E6%88%91%E8%BE%93%E5%85%A5df%3Ddiff%28%27x%5E3-3%2Ax-1%27%29%E5%9B%9E%E8%BD%A6%E5%90%8E%E5%BE%97%E5%88%B0%E7%9A%84%E6%98%AF%EF%BC%9Adf+%3D+-26+-43+-6+6+-9+78+-75+4+%E4%B8%BA%E4%BB%80%E4%B9%88%E5%BE%97%E5%AF%BC%E6%95%B0%3F)
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 78 -75 4 为什么得导数?
matlab中我输入df=diff('x^3-3*x-1')回车后得到的是:df = -26 -43 -6 6 -9 78 -75 4 为什么得导数?
>> 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码的差.