如何根据一些离散点,用matlab拟合函数,函数未知,z=[0.012,0.022,0.032,0.042,0.052,0.062,0.072,0.082,0.092,0.102,0.112,0.122,0.132,0.202,0.302,0.402,0.502,1.002,2.002,10.002,20.002];NU=[8.0239,6.7271,6.0510,5.6209,5.3188,5.0939,4.9198,4.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 22:50:19
如何根据一些离散点,用matlab拟合函数,函数未知,z=[0.012,0.022,0.032,0.042,0.052,0.062,0.072,0.082,0.092,0.102,0.112,0.122,0.132,0.202,0.302,0.402,0.502,1.002,2.002,10.002,20.002];NU=[8.0239,6.7271,6.0510,5.6209,5.3188,5.0939,4.9198,4.
如何根据一些离散点,用matlab拟合函数,函数未知,
z=[0.012,0.022,0.032,0.042,0.052,0.062,0.072,0.082,0.092,0.102,0.112,0.122,0.132,0.202,0.302,0.402,0.502,1.002,2.002,10.002,20.002];
NU=[8.0239,6.7271,6.0510,5.6209,5.3188,5.0939,4.9198,4.7812,4.6684,4.5751,4.4968,4.4303,4.3731,4.1216,3.9713,3.8931,3.8460,3.7516,3.7042,3.6663,3.6615]
需要得到NU和z对应的关系式.
我是初学者,希望你能把详细的matlab解题和答案过程给我说说,
如何根据一些离散点,用matlab拟合函数,函数未知,z=[0.012,0.022,0.032,0.042,0.052,0.062,0.072,0.082,0.092,0.102,0.112,0.122,0.132,0.202,0.302,0.402,0.502,1.002,2.002,10.002,20.002];NU=[8.0239,6.7271,6.0510,5.6209,5.3188,5.0939,4.9198,4.
你要的拟合问题,有很多种方式
如果你需要的一条函数,希望尽量靠近这些点,但是可以不过这些数据点,可以用最小二乘法去求这么一个函数,具体的函数形式,也是由你自己定
如果你要这个拟合函数过这些数据点,那么可以用很多种函数来拟合,常见的有多项式插值和样条插值,多项式的稳定性不好,样条插值是很常用而且效果很好的插值方法,可以保证连续性以及一次导数的连续性
我给你个code,你试试看
z 和 nu都是按你的输入进去
zz = z; % 可以取的更密集一些
new = spline(z,NU,zz); % 这个就是用你给的点做的样条
plot (zz,new); 画出新的插值函数
不过这种情况下,没有解析关系可以给出