Issue with diff function, symbolic toolbox, three tiny lines of code to illustrate!
이전 댓글 표시
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개)
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!