calculate the derivative of the function log(sin(2x)), simplify the result
4 views (last 30 days)
Show older comments
pretty(simplify(diff('log(sin(2*x))','x'))) Error using diff Difference order N must be a positive integer scalar.
1 Comment
Jan
on 13 Dec 2016
@Yaser: In your example the input for diff() is a string, which is treated like a numerical vector containing ASCII codes. Most likely you want a symbolic expression, so see KSSV's answer.
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!