matlab中函数句柄应用问题?F=@(x)[x(1)+t*x(3)+0.5*t^2*x(5);x(2)+t*x(4)+0.5*t^2*x(6);...x(3)+t*x(5);x(4)+t*x(6);x(5);x(6)];H=@(x)[sqrt(x(1)^2+x(2)^2);atan(x(2)/x(1))];Xk=zeros(6,50);Xk_predict=@(x)F*XO;Pk_predict=@(x)F*PO*F'+Q;%预测误差协
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/14 11:44:16
matlab中函数句柄应用问题?F=@(x)[x(1)+t*x(3)+0.5*t^2*x(5);x(2)+t*x(4)+0.5*t^2*x(6);...x(3)+t*x(5);x(4)+t*x(6);x(5);x(6)];H=@(x)[sqrt(x(1)^2+x(2)^2);atan(x(2)/x(1))];Xk=zeros(6,50);Xk_predict=@(x)F*XO;Pk_predict=@(x)F*PO*F'+Q;%预测误差协
matlab中函数句柄应用问题?
F=@(x)[x(1)+t*x(3)+0.5*t^2*x(5);x(2)+t*x(4)+0.5*t^2*x(6);...
x(3)+t*x(5);x(4)+t*x(6);x(5);x(6)];
H=@(x)[sqrt(x(1)^2+x(2)^2);atan(x(2)/x(1))];
Xk=zeros(6,50);
Xk_predict=@(x)F*XO;
Pk_predict=@(x)F*PO*F'+Q;%预测误差协方差阵
S=@(x)H*Pk_predict*H'+R;%信息协方差阵 K=@(x)Pk_predict*H'*inv(S);%增益矩阵
xxx=(@(x)Xk_predict+K*(Z(:,Node_Num(b))-H*Xk_predict));%估计矩阵(最后的输出值)
Xk(:,k)=xxx;
运行后会显示
Conversion to double from function_handle is not possible.
Error in ==> kalmanquxian at 102
Xk(:,k)=xxx;
matlab中函数句柄应用问题?F=@(x)[x(1)+t*x(3)+0.5*t^2*x(5);x(2)+t*x(4)+0.5*t^2*x(6);...x(3)+t*x(5);x(4)+t*x(6);x(5);x(6)];H=@(x)[sqrt(x(1)^2+x(2)^2);atan(x(2)/x(1))];Xk=zeros(6,50);Xk_predict=@(x)F*XO;Pk_predict=@(x)F*PO*F'+Q;%预测误差协
是啊 您把函数句柄赋值给一个矩阵,显然不对的啊.您的意图是什么?