numerical derivation of function ?
2 views (last 30 days)
Show older comments
Waleed new
on 20 Jun 2018
Commented: Waleed new
on 20 Jun 2018
how to derivate this function in matlab :
func = q*sin(phi)+r*cos(teta)
where q , r , teta ,phi are functions , how to find the derivative expression like this :
deriv_func =qdot*sin(phi)+phidot*cos(phi)*q +rdot*cos(teta)-tetadot*sin(teta)*r
0 Comments
Accepted Answer
Walter Roberson
on 20 Jun 2018
You cannot do that numerically. Numeric differentiation can never return a symbolic result.
With the symbolic toolbox, you would do something like,
syms q(t) r(t) phi(t) teta(t)
func = q*sin(phi)+r*cos(teta)
diff(func, t)
to get
cos(teta(t))*diff(r(t), t) + sin(phi(t))*diff(q(t), t) + cos(phi(t))*q(t)*diff(phi(t), t) - sin(teta(t))*r(t)*diff(teta(t), t)
You indicated that q r phi teta were functions, but you did not indicate what they were functions of, so I assumed they were all functions of t.
More Answers (0)
See Also
Categories
Find more on Number Theory in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!