How to solve vector equation y = mx +c

7 ビュー (過去 30 日間)
Govind Sankar Madhavan Pillai Ramachandran Nair
回答済み: Paul 2025 年 5 月 28 日
I have 5 linear equations.
3.2790m + n = 661
1.9704m + n = 401
0.9757m + n = 201
0.4835m + n = 101
0.2425m + n = 51
I know to solve by hand, I only need two of these equations. But if I solve using different set of two equations, i get close values for m and n but still different. So i need to use all 5 equations to calibrate and get the best values for m and n. I dont have sys math tool box. So is to possible to write this as a vector m*[3.2790 1.9704 0.9757 0.4835 0.2425] + n*[1 1 1 1 1] = [661 401 201 101 51] and solve this vector equation in matlab and get the best solution for m and n. How can I do that? Thank you.

採用された回答

Paul
Paul 2025 年 5 月 28 日
% A*[m;n] = b
A = [3.2790 1;
1.9704 1;
0.9757 1;
0.4835 1;
0.2425 1];
b = [661 401 201 101 51].';
See @doc:mldivide for details (mldivide)
z = A\b;
m = z(1)
m = 200.7464
n = z(2)
n = 3.9183

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

タグ

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by