How to find optimum value to minimize error?

1 view (last 30 days)
for e.g. How to find optimum value of m & c? given, Ye=mx+c; x=[0 1 2 3 4]; Ye=[3 5 7 9 11]; to minimize error

Answers (1)

Torsten
Torsten on 13 Oct 2015
A=[0 1;1 1;2 1;3 1;4 1];
b=[3; 5; 7; 9 ; 11];
x=A\b;
m=x(1);
c=x(2);
Best wishes
Torsten.

Community Treasure Hunt

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

Start Hunting!