使用Matlab进行拟合是图像处理中线条变换的一个重点内容,本文将详解Matlab中的直线拟合和曲线拟合用法。
关键函数:
fittype
Fit type for curve and surface fitting
Syntax
ffun = fittype(libname)
ffun = fittype(expr)
ffun = fittype({expr1,...,exprn})
ffun = fittype(expr, Name, Value,...)
ffun= fittype({expr1,...,exprn}, Name, Value,...)
/***********************************线性拟合***********************************/
线性拟合公式:
coeff1 * term1 + coeff2 * term2 + coeff3 * term3 + ...其中,coefficient是系数,term都是x的一次项。