Solving an overdetermined linear system

7 Ansichten (letzte 30 Tage)
Mustafa Duran
Mustafa Duran am 8 Aug. 2023
Bearbeitet: Bruno Luong am 8 Aug. 2023
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

Akzeptierte Antwort

Bruno Luong
Bruno Luong am 8 Aug. 2023
Bearbeitet: Bruno Luong am 8 Aug. 2023
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 = 

Weitere Antworten (0)

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by