Description: [coef, RSquared]=plotfit(x,y,polyorder)
A simple function that accepts x,y data pairs in in the vectors "x" and "y", fits it to a polynomial of order "polyorder", plots the data and the fit, and displays the fit coefficients and the goodness-of-fit measure R-squared in the upper left corner of the graph. Set "polyorder" = 1 for straight line, = 2 for quadratic (parabola), etc. Optionally returns the polynomial coefficients and the R-squared value. Uses Matlab's polyfit, polyval, and linspace functions.
Related: quadratic, parabola, straight, Graph, upper, Corner, optionally, returns, linspace, Functions, polyval, polyfit, matlab, rsquared, Measure, Vectors, quotxquot, pairs, accepts, quot
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB