Solving an overdetermined linear system
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Mustafa Duran
il 8 Ago 2023
Modificato: Bruno Luong
il 8 Ago 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
0 Commenti
Risposta accettata
Bruno Luong
il 8 Ago 2023
Modificato: Bruno Luong
il 8 Ago 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)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Systems of Nonlinear Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!