Finding equation parameters from data set?

19 views (last 30 days)
Emanuele Joy
Emanuele Joy on 31 May 2018
Answered: KSSV on 31 May 2018
I have a data set of x and y:
x = [2.0, 2.5, 3.0, 3.5, 6.0, 6.1, 8.5, 8.6, 9.9, 10.0];
y = [0.001, 0.006, 0.032, 0.180, 1E3, 2E3, 5.6E6, 8E6, 5E8, 1E9];
I'm looking to do different polynomial fits (linear, quadratic, exponential, power, logarithmic) from this data, but I need to know the equation constants/parameters (like slope and intercept) before I can fit them.
For example, a linear equation takes the form "y = m*x + b", and I want to know "m" and "b". Same with quadraatic equation, y = a*x^2 + b*x +c, I want to know a, b, and c. How do I solve for these given the data and built-in MATLAB functions? Do I have to use a matrix operation of some kind?

Answers (1)

KSSV
KSSV on 31 May 2018

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!