If x=[0 1 2 3 4 5]; and y=[0 20 60 68 77 110]; To get a linear equation I can use coefficients=polyfit(x,y,1) which gives me coefficients 20.8286 3.7619 so my linear equation is y = 20.8286 x + 3.7619 If I want to find an unknown y value from a known x value e.g. 1.5 I can use y=polyval(coefficients, 1.5) and I get y = 35.0048. In other words, using polyval, and using the equation derived from polyfit, when x = 1.5, y = 35.0048.
However, if I want to find an unknown x value from a known y value, what do I do?
Kind regards, Wendy
Best Answer