Fortune Telling Collection - Fortune-telling birth date - How to find the differential of function with MATLAB
How to find the differential of function with MATLAB
Symbolic operation
The Diff function is used to calculate the differential term of the function, and the related function syntax is as follows:
Diff(f) returns the first differential value of f to the preset independent variable.
Diff(f,' t') returns the first differential value of f to the independent variable t.
Diff(f, n) returns the nth differential value of f to a preset independent variable.
Diff(f,' t', n) returns the nth differential value of f to the independent variable t.
That is, the calling format of matlab derivative command diff:
The first derivative of Diff (function);
The nth derivative of Diff (function, n) (n is a specific integer);
Diff (function, variable name), find the partial derivative of the pair;
Diff (function, variable name, n), find the n-order partial derivative of the pair;
Diff is also used in numerical differential function, so this function depends on input parameters to decide whether it is numerical differential or sign differential. If the parameter is a vector, numerical differentiation is performed, and if the parameter is a symbolic expression, symbolic differentiation is performed. If a one-dimensional vector of length n is input, the function will return a vector of length n- 1, and the value of the vector is the difference between the adjacent elements of the original vector, so the finite difference approximation of the first derivative can be calculated.
First, define the following three equations, and then calculate their differential terms:
& gt& gts 1 = '6*x^3-4*x^2+b*x-5';
& gt& gtS2 =' Crime (1)';
& gt& gtS3 = '( 1-t^3)/( 1+t^4)';
& gt& gt difference (S 1)
ans= 18*x^2-8*x+b
& gt& gt difference (S 1, 2)
ans= 36*x-8
& gt& gtdiff(S 1,' b ')
ans= x
& gt& gt difference (S2)
ans= cos(a)
& gt& gt difference (S3)
ans=-3*t^2/( 1+t^4)-4*( 1-t^3)/( 1+t^4)^2*t^3
& gt& gt Simplification (Difference (S3))
Answer = t 2 * (-3+t 4-4 * t)/(1+t 4) 2
- Related articles
- 1967 How was the marriage between a sheep and a mouse in 1984?
- Sunglasses fortune teller _ Sunglasses fortune teller
- Eye pattern fortune telling _ eye fortune telling
- Lunar calendar 1 1. 14 fortune telling
- Sigh fortune-telling feng shui _ sigh fortune-telling feng shui blog
- What are the arguments about the number of finger threads?
- Li Hua's fortune-telling in Yue Opera _ Introduction to Li Hua's fortune-telling stories in Yue Opera
- Fortune-telling 22_ Fortune-telling 22 cannot be counted.
- Where is the subway station in Huangzhai Town, Pujiang County?
- Jingdezhen historical sites