Solving an overdetermined linear system

조회 수: 8 (최근 30일)
Mustafa Duran
Mustafa Duran 2023년 8월 8일
편집: Bruno Luong 2023년 8월 8일
My code is like that and MATLAB gives me error of inconsistancy, how can i solve overdetermined linear system?
syms e0 e1 e2
T1=1;
T2=3;
T3=4;
T4=5;
T5=6;
TM1=8;
TM2=7;
TM3=6;
TM4=5;
TM5=4;
Eqns = [e0 + T1*TM1*e1 - T1*e2 == TM1
e0 + T2*TM2*e1 - T2*e2 == TM2
e0 + T3*TM3*e1 - T3*e2 == TM3
e0 + T4*TM4*e1 - T4*e2 == TM4
e0 + T5*TM5*e1 - T5*e2 == TM5];
[A,b] = equationsToMatrix(Eqns, [e0, e1, e2]);
x=linsolve(A,b);
x
OUTPUT:
Warning: Solution does not exist because the system is inconsistent.
x =
Inf
Inf
Inf

채택된 답변

Bruno Luong
Bruno Luong 2023년 8월 8일
편집: Bruno Luong 2023년 8월 8일
least square solution
syms e0 e1 e2
T1=1;
T2=3;
T3=4;
T4=5;
T5=6;
TM1=8;
TM2=7;
TM3=6;
TM4=5;
TM5=4;
Eqns = [e0 + T1*TM1*e1 - T1*e2 == TM1
e0 + T2*TM2*e1 - T2*e2 == TM2
e0 + T3*TM3*e1 - T3*e2 == TM3
e0 + T4*TM4*e1 - T4*e2 == TM4
e0 + T5*TM5*e1 - T5*e2 == TM5];
[A,b] = equationsToMatrix(Eqns, [e0, e1, e2]);
x = (A'*A)\(A'*b)
x = 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by