matlab程序解释:最小二乘法。 求大神指教怎么输入未知数???
function[estimated_position]=Algo_LSE(X,Y,Z,D)Num_temp=size(X);Q=eye(Num_temp(2));for...
function [estimated_position]=Algo_LSE(X,Y,Z,D)
Num_temp=size(X);
Q=eye(Num_temp(2));
for i=1:Num_temp(2)
K(i)=X(i)^2+Y(i)^2+Z(i)^2;
h(i,1)=D(i)^2-K(i);
Ga(i,:)=[-2*X(i),-2*Y(i),-2*Z(i),1];
end
Za0=inv(Ga'*inv(Q)*Ga)*Ga'*inv(Q)*h;
estimated_position=Za0(1:3);
end 展开
Num_temp=size(X);
Q=eye(Num_temp(2));
for i=1:Num_temp(2)
K(i)=X(i)^2+Y(i)^2+Z(i)^2;
h(i,1)=D(i)^2-K(i);
Ga(i,:)=[-2*X(i),-2*Y(i),-2*Z(i),1];
end
Za0=inv(Ga'*inv(Q)*Ga)*Ga'*inv(Q)*h;
estimated_position=Za0(1:3);
end 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询