system of nonlinear equations
1 回表示 (過去 30 日間)
古いコメントを表示
I tried to solve this system of ecuation but somenthing it´s wrong :![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/547148/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/547148/image.png)
this is the code:
Ay=1
Az=-2
By=2
Bz=-1
r=1
x = optimvar('x',2);
ec1=((x(1)-Ay)^2+(x(2)-Az)^2)==r^2;
ec2=((x(1)-(Ay))^2+(x(2)-(Az))^2)==((x(1)-((By))^2+(x(2)-(Bz))^2));
prob = eqnproblem;
prob.Equations.ec1 = ec1;
prob.Equations.ec2 = ec2;
show(prob)
x0.x = [1 -2];
[sol,fval,exitflag] = solve(prob,x0)
disp(sol.x)
0 件のコメント
採用された回答
Alan Weiss
2021 年 3 月 12 日
Do you have Optimization Toolbox™ installed? Check by running the ver command. You might need to install or reinstall.
Alan Weiss
MATLAB mathematical toolbox documentation
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Systems of Nonlinear Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!