急.求高手帮助matlab拟合求一个函数、曲线x有等于1到24 y是 550 552.3\x05554.5\x05559.1\x05561.4\x05586.4\x05645.5\x05690.9\x05709.1\x05718.2\x05690.9\x05656.8\x05645.5\x05615.9\x05593.2\x05586.4\x05618.2\x05663.6\x05681.8\x05690.9\x
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 17:27:08
急.求高手帮助matlab拟合求一个函数、曲线x有等于1到24 y是 550 552.3\x05554.5\x05559.1\x05561.4\x05586.4\x05645.5\x05690.9\x05709.1\x05718.2\x05690.9\x05656.8\x05645.5\x05615.9\x05593.2\x05586.4\x05618.2\x05663.6\x05681.8\x05690.9\x
急.求高手帮助matlab拟合求一个函数、曲线
x有等于1到24 y是 550 552.3\x05554.5\x05559.1\x05561.4\x05586.4\x05645.5\x05690.9\x05709.1\x05718.2\x05690.9\x05656.8\x05645.5\x05615.9\x05593.2\x05586.4\x05618.2\x05663.6\x05681.8\x05690.9\x05677.3\x05654.5\x05609.1\x05563.6
拟合出的系数不精确,导致最后的函数不准确啊~
急.求高手帮助matlab拟合求一个函数、曲线x有等于1到24 y是 550 552.3\x05554.5\x05559.1\x05561.4\x05586.4\x05645.5\x05690.9\x05709.1\x05718.2\x05690.9\x05656.8\x05645.5\x05615.9\x05593.2\x05586.4\x05618.2\x05663.6\x05681.8\x05690.9\x
x=1:24;
y=[550 552.3554.5559.1561.4586.4645.5690.9709.1718.2690.9656.8645.5615.9593.2586.4618.2663.6681.8690.9677.3654.5609.1563.6];
p=polyfit(x,y,7);
y1=polyval(p,x);
figure
plot(x,y,x,y1)
可以看出使用七次多项式拟合的结果还是不错的!