I want to find the value of k

조회 수: 15 (최근 30일)
SANDIPKUMAR ROYADHIKARI
SANDIPKUMAR ROYADHIKARI 2021년 10월 23일
댓글: SANDIPKUMAR ROYADHIKARI 2021년 10월 23일
syms x1 x2 x3
x=[x1;x2;x3];
f1=x(1)^3+12*x(2)+1;
f2=x(2)^9+5*x(1)-3;
f3=x(2)*x(3)^2+8;
k=[diff(f1,x(1)),diff(f1,x(2)),diff(f1,x(3));diff(f2,x(1)),diff(f2,x(2)),diff(f2,x(3));diff(f3,x(1)),diff(f3,x(2)),diff(f3,x(3))];
x=[2;5;9];
With these values of x
I want to find out the value of k, how do I do that ?

답변 (1개)

John D'Errico
John D'Errico 2021년 10월 23일
syms x1 x2 x3
x=[x1;x2;x3];
f1=x(1)^3+12*x(2)+1;
f2=x(2)^9+5*x(1)-3;
f3=x(2)*x(3)^2+8;
Here is the matrix k.
k=[diff(f1,x(1)),diff(f1,x(2)),diff(f1,x(3));diff(f2,x(1)),diff(f2,x(2)),diff(f2,x(3));diff(f3,x(1)),diff(f3,x(2)),diff(f3,x(3))]
k = 
So, a function of x1, x2, and x3.
Why did you define x as x=[x1;x2;x3];, when you never used it again?
If you wish to substitute for x1, x2, x3, you could do this:
subs(k,[x1,x2,x3],[2 5 9])
ans = 

카테고리

Help CenterFile Exchange에서 Number Theory에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by