Solving a math problem with two unknowns using matlab (linear least square/optimization)
Afficher commentaires plus anciens
Consider these equations:
-7.02 = -(49.600)*(A) + (-0.2213)*(B)
-7.84 = -(68.809)*(A) + (-0.2213)*(B)
-6.27 = -(63.307)*(A) + (-0.1510)*(B)
-7.33 = -(65.438)*(A) + (-0.1468)*(B)
I'm sorry its really basic but i don't know how to solve it in matlab. Could you please write the answer and show the code and how you arrive at your answer? HINT: B will be close to 0.40!!
Please help me out here.
Thanks a lot in advance!!!
Réponses (1)
Paulo Silva
le 7 Mai 2011
I=[-7.02
-7.84
-6.27
-7.33];
D=[-49.600 -0.2213
-68.809 -0.2213
-63.307 -0.1510
-65.438 -0.1468];
s=D\I; % s=linsolve(D,I) %same result
fprintf('A=%f and B=%f\n',s(1),s(2))
Catégories
En savoir plus sur Linear Least Squares dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!