椭圆的拟合优度用什么指标评价啊。
Show older comments
我用如下的程序进行了椭圆拟合,如何评价其拟合效果啊?在网上查的用R^2,这个R^2事如何计算的呢?x=【-0.067624357,-0.003359844,0.063037813,0.089413159,0.059020652,-0.008843696,-0.071093237,-0.088206129
-0.049317504,0.020882494,0.077824328,0.085355985,0.038695664,-0.032532291,-0.083105699,-0.080915821,-0.027352997
0.043576072,0.086838968,0.074968348,0.015500796,-0.053808114-0.088954591】
y=【0.268839461 ,1.714580918,2.071745728,1.113572199,-0.551601318,-1.866566626,-1.996460517,-0.858814177,0.824087886,1.98378173,1.883985025,0.588058071,-1.081223256,-2.064042734,-1.736414456,-0.306347556,1.318217482
2.105854527,1.556497772,0.018930366,-1.530655811,-2.108438235,-1.347586479】
XY=[x,y];
F=@(p,XY)p(1)*XY(:,1).^2+p(2)*XY(:,1).*XY(:,2)+p(3)*XY(:,2).^2+p(4)*XY(:,1)+p(5)*XY (:,2)+p(6);%椭圆一般方程
p0=[1 1 1 1 1 1];
p=nlinfit(XY, zeros(size(XY,1),1), F, p0);
plot(XY(:,1), XY(:,2), 'ro');
hold on;
xmin=min(XY(:, 1));
xmax=max(XY(:, 1));
ymin=min(XY(:, 2));
ymax=max(XY(:, 2));
ezplot(@(x,y)F(p,[x,y]), [-1+xmin,1+xmax,-1+ymin,1+ymax]);

Accepted Answer
More Answers (0)
Categories
Find more on 变量 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!