Turn: https://blog.csdn.net/hwecc/article/details/80308397
Example:
= x [ 0.33 , 1.12 , 1.41 , 1.71 , 2.19 ] y = [ 0.68 , 0.91 , 1.15 , 1.83 , 2.07 ] % fitted P1 = polyfit (x, y, 1 )% by fitting a polynomial of x and y, 1 represents a polynomial % output 0.8025 0.2431 % is represented by the polynomial F (X) = 0.8025 * X + 0.2431 % graphing Y1 = polyval (P1, X) Plot (X, Y, '*', x, y1, '-')