本文浅析了2种直线拟合的方法,并对两种方法拟合直线的精度和算法复杂度进行了分析.这2种方法的基本思路都是基于最小二乘法,但是从计算的复杂性方面存在一定的差别,针对2种算法在Matlab平台上进行拟合,并对相应的结果进行了分析,同时也给出了拟合的部分代码作为参考.
In this paper,the two straight-line fitting methods are briefly analyzed,and the accuracy and algorithm complexity of the two methods for fitting straight lines are analyzed.The basic idea of both methods is based on the least squares method,but there are certain differences in the complexity of the calculation,and the two algorithms are fitted on the Matlab platform and the corresponding results are analyzed.At the same time,the part of the fitting codes is also given as a reference.