|
给个例子
for v6.5
>> x = (0: 0.2: 1)'; y = erf(x); x2=[x;x]; y2=[y;y];
>> p = polyfit(x,y,6)
Warning: Polynomial is not unique; degree >= number of data points.
(Type "warning off MATLAB:polyfit:PolyNotUnique" to suppress this warning.)
> In C:\MATLAB6p5\toolbox\matlab\polyfun\polyfit.m at line 68
p = 0.0030 0 0.1542 -0.4624 0.0215 1.1265 0.0000
>> p2 = polyfit(x2,y2,6)
Warning: Polynomial is badly conditioned. Remove repeated data points
or try centering and scaling as described in HELP POLYFIT.
(Type "warning off MATLAB:polyfit:RepeatedPointsOrRescale" to suppress this warning.)
> In C:\MATLAB6p5\toolbox\matlab\polyfun\polyfit.m at line 75
p2 = -0.5730 1.7279 -1.8041 0.5743 -0.2310 1.1486 0.0000
>> p2 = polyfit(x2,y2,5)
p2 = 0.0090 0.1440 -0.4570 0.0202 1.1266 0.0000
>> p = polyfit(x,y,5)
p = 0.0090 0.1440 -0.4570 0.0202 1.1266 0.0000
for R2006a
>> x = (0: 0.2: 1)'; y = erf(x); x2=[x;x]; y2=[y;y];
>> p = polyfit(x,y,6)
Warning: Polynomial is not unique; degree >= number of data points.
> In polyfit at 72
p = 0.0030 0 0.1542 -0.4624 0.0215 1.1265 -0.0000
>> p2 = polyfit(x2,y2,6)
Warning: Polynomial is badly conditioned. Add points with distinct X
values, reduce the degree of the polynomial, or try centering
and scaling as described in HELP POLYFIT.
> In polyfit at 80
p2 = -0.4050 1.2240 -1.2331 0.2720 -0.1574 1.1421 -0.0000
>> p = polyfit(x,y,5)
p = 0.0090 0.1440 -0.4570 0.0202 1.1266 0.0000
>> p2 = polyfit(x2,y2,5)
p2 = 0.0090 0.1440 -0.4570 0.0202 1.1266 -0.0000
for R2009a
>> p2 = polyfit(x2,y2,6)
Warning: Polynomial is badly conditioned. Add points with distinct X
values, reduce the degree of the polynomial, or try centering
and scaling as described in HELP POLYFIT.
> In polyfit at 80
p2 =
-0.5135 1.5496 -1.6021 0.4673 -0.2050 1.1463 -0.0000
**** other is same R2006a ****
[ 本帖最后由 ChaChing 于 2010-3-21 16:56 编辑 ] |
评分
-
1
查看全部评分
-
|