How to do partial differentiation of functions?
조회 수: 1 (최근 30일)
이전 댓글 표시
x10=2;
x20=-2;
x30=1;
e1=0.00001;
z = sym('2*x1 * x1 + x2*x2 + 3*x3*x3');
syms x1 x2 x3 a;
gradz = [diff(z,x1); diff(z,x2); diff(z,x3)]; % returns a column vector
p0=subs(gradz, [x1 x2 x3], [x10 x20 x30]); % evaluate at (0.25, 0.75)
x1a0=x10+a*p0(1);
x2a0=x20+a*p0(2);
x3a0=x30+a*p0(3);
This is some part of code. i want to do partial differentiation of particular function w.r.t. variables x1,x2,x3. How to do it numericaly. Its working when i am doing it by using symbolic toolbox. How to do it by using already stored syntax....like 'ode 45'(i know ode cant solve above problem....i have just mentioned to specify type).
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!