matlab 曲线拟合的问题x=[1.870592E+072.003366E+072.074818E+072.194041E+072.264339E+072.330242E+072.321209E+072.324987E+071.414927E+071.413807E+071.879982E+071.901068E+071.928789E+071.949394E+071.968775E+072.003045E+072.037739E+072.060624E+072.0
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/12 21:34:39
matlab 曲线拟合的问题x=[1.870592E+072.003366E+072.074818E+072.194041E+072.264339E+072.330242E+072.321209E+072.324987E+071.414927E+071.413807E+071.879982E+071.901068E+071.928789E+071.949394E+071.968775E+072.003045E+072.037739E+072.060624E+072.0
matlab 曲线拟合的问题
x=[1.870592E+07
2.003366E+07
2.074818E+07
2.194041E+07
2.264339E+07
2.330242E+07
2.321209E+07
2.324987E+07
1.414927E+07
1.413807E+07
1.879982E+07
1.901068E+07
1.928789E+07
1.949394E+07
1.968775E+07
2.003045E+07
2.037739E+07
2.060624E+07
2.067867E+07
2.121926E+07
2.161368E+07
2.196016E+07
2.235986E+07
2.266084E+07
2.303457E+07
2.300120E+07
2.359826E+07
2.322719E+07
1.431619E+07
1.420434E+07
1.419769E+07
];
y=[-20.00
-17.00
-15.00
-12.00
-10.00
-8.00
-7.00
-6.00
-5.50
-5.30
-5.00
-4.50
-4.00
-3.50
-3.00
-2.00
-1.00
-0.50
0.00
1.00
2.00
3.00
4.00
5.00
6.00
7.00
8.00
9.00
9.50
9.60
9.80
];
plot(y,x)
p=polyfit(y,x,9);
hold on
plot(y,p(1)*y.^9+p(2).*y.^8+p(3).*y.^7+p(4).*y.^6+p(5).*y.^5+p(6).*y.^4+p(7).*y.^3+p(8).*y.^2+p(9).*y.^1+p(10))
画出的图,还是不太一致啊
matlab 曲线拟合的问题x=[1.870592E+072.003366E+072.074818E+072.194041E+072.264339E+072.330242E+072.321209E+072.324987E+071.414927E+071.413807E+071.879982E+071.901068E+071.928789E+071.949394E+071.968775E+072.003045E+072.037739E+072.060624E+072.0
可以这样写
plot(y,x,'.-')
p=polyfit(y,x,9);
hold on
xv=polyval(p,y);
plot(y,xv,'r-*')
至于图形的问题 可能你选的公式不太好