Issue with diff function, symbolic toolbox, three tiny lines of code to illustrate!
1 view (last 30 days)
Show older comments
Hi there!
I'm trying to use the diff function in Matlab for a very, very complicated piece of code. There's an issue, however. Suppose I have an arbitrary function, say, a(x). I want to symbolically take lots of derivatives of a(x), and then substitute in for various x's later. This is a problem though.
For example
syms x y z
syms a(u)
diff(a(x),x)
This is wrong. What I want is the answer I get from this
syms u
syms a(u)
diff(a)
ans(u) =
D(a)(u)
Except I want to be able to do that for many, many 'u's. I know there must be a simple solution to this problem, but I can't figure it out.
0 Comments
Answers (0)
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!