Solving 3 equations with 3 unknowns

조회 수: 4 (최근 30일)
Kristine
Kristine 2022년 10월 2일
편집: Torsten 2022년 10월 2일
Hi! I am trying to see if Matlab would help me solve 3 equations with 3 unknowns. Thank you in advance!
52.11=2*[(sqrt(x*44.4)]
52.89=2*[(sqrt(x*34)+(sqrt(y*3.92)+(sqrt(z*57.4)]
46.71=2*[(sqrt(x*21.8)+(sqrt(y*25.5)+(sqrt(z*25.5)]
For the first equation, y and z=0.
Would something like this work:
syms x y z
E1 = 2*sqrt(x*44.4) == 52.11;
E2 = 2*((sqrt(x*34))+(sqrt(y*3.92))+(sqrt(z*57.4))) == 52.89;
E3 = 2*((sqrt(x*21.8))+(sqrt(y*25.5))+(sqrt(z*25.5))) == 46.71;
result = solve(E1,E2,E3);

채택된 답변

Torsten
Torsten 2022년 10월 2일
편집: Torsten 2022년 10월 2일
No problem.
A = [2*sqrt(44.4) 0 0; 2*sqrt(34) 2*sqrt(3.92) 2*sqrt(57.4);2*sqrt(21.8) 2*sqrt(25.5) 2*sqrt(25.5)];
b = [52.11;52.89;46.71];
sol = A\b
sol = 3×1
3.9102 0.7155 0.2941
x = sol(1)^2
x = 15.2897
y = sol(2)^2
y = 0.5119
z = sol(3)^2
z = 0.0865
A*sqrt([x;y;z])-b
ans = 3×1
0 0 0

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by