MATLAB: How to predict x values for a dataset of y values using a fitted polynomial model of y/x values

curve fitting

I have immunoassay data with OD values for different concentration of antigen. I fitted a polynomial function (2 degree) to the data (y=OD, x=concentration). Now I need to predict concentrations based on measured ODs (which are on a collumn vector). How can I do that?
Thanks

Best Answer

Get the equation:
coeffs = polyfit(x, y, 2);
Then get the x values for any particular y value with roots():
a = coeffs(1);
b = coeffs(2);
c = coeffs(3) - y;
x = roots([a, b, c]) % Will be vector of two values.