作者:香柏林茶业 | 来源:互联网 | 2023-08-17 13:06
MATLAB线性拟合ployfit函数xlinspace(0,1,20);y2*x+0.2*randn([1,20]);pfpolyfit(x,y,1);figure;plot(x
MATLAB 线性拟合
ployfit函数
x = linspace(0,1,20);
y = 2*x + 0.2*randn([1,20]);
pf = polyfit(x,y,1);
figure;plot(x,y,'o',x,polyval(t,x))