matlab小段代码求解释function [R,mx,my,mse]=circle_detect(x,y)N=length(x);a1=2*(sum(x)^2-N*sum(x.*x));a2=2*(sum(x)*sum(y)-N*sum(x.*y));b1=a2;b2=2*(sum(y)^2-N*sum(y.*y));c1=sum(x.*x)*sum(x)-N*sum(x.^3)+sum(x)*sum(y.*y)-N*sum(x.*y.*y);c2=sum(x.*x

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/16 05:49:52
matlab小段代码求解释function [R,mx,my,mse]=circle_detect(x,y)N=length(x);a1=2*(sum(x)^2-N*sum(x.*x));a2=2*(sum(x)*sum(y)-N*sum(x.*y));b1=a2;b2=2*(sum(y)^2-N*sum(y.*y));c1=sum(x.*x)*sum(x)-N*sum(x.^3)+sum(x)*sum(y.*y)-N*sum(x.*y.*y);c2=sum(x.*x
xSn@cyX&'d-"6*eL]ɳK4#<JhJTX$)"g ƎPX"Y{9ΙqYE0-2}FǗQ4ܢѲs`ӵ; a y]h }wljzq@ MM"6KPQ^wՑc9Z޳Rz[ 6?#wdOHY &,(/OYah c:\ϻbz^r*Eȏ_j/^W{JE[M'L

matlab小段代码求解释function [R,mx,my,mse]=circle_detect(x,y)N=length(x);a1=2*(sum(x)^2-N*sum(x.*x));a2=2*(sum(x)*sum(y)-N*sum(x.*y));b1=a2;b2=2*(sum(y)^2-N*sum(y.*y));c1=sum(x.*x)*sum(x)-N*sum(x.^3)+sum(x)*sum(y.*y)-N*sum(x.*y.*y);c2=sum(x.*x
matlab小段代码求解释
function [R,mx,my,mse]=circle_detect(x,y)
N=length(x);
a1=2*(sum(x)^2-N*sum(x.*x));
a2=2*(sum(x)*sum(y)-N*sum(x.*y));
b1=a2;
b2=2*(sum(y)^2-N*sum(y.*y));
c1=sum(x.*x)*sum(x)-N*sum(x.^3)+sum(x)*sum(y.*y)-N*sum(x.*y.*y);
c2=sum(x.*x)*sum(y)-N*sum(y.^3)+sum(y)*sum(y.*y)-N*sum(x.*x.*y);
mx=(c1*b2-c2*b1)/(a1*b2-a2*b1);
my=(a1*c2-a2*c1)/(a1*b2-a2*b1);
R=sqrt((sum(x.*x)-2*sum(x)*mx+N*mx*mx+sum(y.*y)-2*sum(y)*my+N*my*my)/N);
e=((x-mx).^2+(y-my).^2-R*R)/(R*R);
mse=mean(e.*e);
这是一个检测圆圈的代码,这里面的mx,my,R,

matlab小段代码求解释function [R,mx,my,mse]=circle_detect(x,y)N=length(x);a1=2*(sum(x)^2-N*sum(x.*x));a2=2*(sum(x)*sum(y)-N*sum(x.*y));b1=a2;b2=2*(sum(y)^2-N*sum(y.*y));c1=sum(x.*x)*sum(x)-N*sum(x.^3)+sum(x)*sum(y.*y)-N*sum(x.*y.*y);c2=sum(x.*x
实话说,没心思看这样的代码,全是计算.
估计mx和my是某点的坐标(我才是圆心)
R应该就是半径
mse就不知道了.