Hello
In the output the values give this result. I want to get the values:
syms X1 X2 X3 X4
eq=[X1^2+X2^2==1949.947, (X1*X3)+(X2*X4)==-28.338, eq3=(X3*X1)+(X4*X2)==-28.338, eq4=X3^2=X4^2-81.892]
[x1,x2,x3,x4]=solve([eq],[X1,X2,X3,X4])
x1 =
Empty sym: 0-by-1
x2 =
Empty sym: 0-by-1
x3 =
Empty sym: 0-by-1
x4 =
Empty sym: 0-by-1
Thank you for helping me

댓글 수: 5

syms X1 X2 X3 X4
eq=[X1^2+X2^2==1949.947, (X1*X3)+(X2*X4)==-28.338, eq3=(X3*X1)+(X4*X2)==-28.338, eq4=X3^2=X4^2-81.892]
[x1,x2,x3,x4]=solve([eq],[X1,X2,X3,X4])
You have eq3= and eq4= in the middle of the []. These days that is equivalent to
eq = [ X1^2+X2^2==1949.947,...
(X1*X3)+(X2*X4)==-28.338, ...
'eq3', ...
(X3*X1)+(X4*X2)==-28.338, ...
'eq4', ...
X3^2=X4^2-81.892]
[x1,x2,x3,x4]=solve([eq],[X1,X2,X3,X4])
Farshid R
Farshid R 2022년 6월 1일
Thank you .According to document version 2018b I would do ,however,it answers these . your code make error in matlab for me. I don ot know really why.
I read document solve.
Is there another way?
Torsten
Torsten 2022년 6월 1일
Is there another way?
Yes: copy KSSV's solution.
Maybe he will be so kind to replace the numbers by symbolic variables so that you can play with the right-hand side of your equations.
Farshid R
Farshid R 2022년 6월 1일
Thank you so much.
Walter Roberson
Walter Roberson 2022년 6월 1일
편집: Walter Roberson 2022년 6월 1일
Your second and third equations are the same. There would not be a unique solution .

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2022년 6월 1일

0 개 추천

syms X1 X2 X3 X4
eq1 = X1^2+X2^2==1949.947 ;
eq2 = (X1*X3)+(X2*X4)==-28.338;
eq3 = (X3*X1)+(X4*X2)==-28.338;
eq4 = X3^2==X4^2-81.892 ;
eqs = [eq1, eq2, eq3, eq4] ;
s=solve(eqs,[X1,X2,X3,X4]) ;
s.X1
ans = 
s.X2
ans = 

댓글 수: 5

Farshid R
Farshid R 2022년 6월 1일
Thank you
But when I execute this code as well as your code, it gives me this output. What do you think why shows these answers?
Empty sym: 0-by-1
What version you are using?
version
ans = '9.12.0.1952421 (R2022a) Update 1'
Farshid R
Farshid R 2022년 6월 1일
I use V.2018b
KSSV
KSSV 2022년 6월 1일
Read the documentation up there. The problem is due to version.
Farshid R
Farshid R 2022년 6월 1일
Many thanks dear

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2022년 6월 1일

편집:

2022년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by