I want to find the value of k
2 次查看(过去 30 天)
显示 更早的评论
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 ?
0 个评论
回答(1 个)
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))]
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])
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Number Theory 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!