meanwm.m

来自「it is a matlab file foe develop SLAM loc」· M 代码 · 共 35 行

M
35
字号
%MEANWM Multivariate weighted mean (Information Filter).%   [XW,CW] = MEANWM(X,C) calculates the multivariate weighted mean%   equivalent to the information filter (IF). X is a matrix of di-%   mension m x n where each column is interpreted as a random vector%   of dimension m x 1. C is a m x m x n matrix where each m x m%   matrix is interpreted as the covariance estimate associated to%   its respective row vector. The function returns the weighted mean%   vector XW and the weighted covariance matrix CW of dimensions%   m x 1 and m x m respectively.%%   See also MEAN.% v.1.0, 14.08.97, Kai Arras, ASL-EPFL% v.1.1, Dec.2003, Kai Arras, CAS-KTHfunction [xwm,Cwm] = meanwm(xv,Cv)% Get size and initialize accumulatorsm = size(xv,1);n = size(xv,2);Caccu = zeros(m);xaccu = zeros(m,1);% Add togetherfor i = 1:n;  Ci = Cv(:,:,i);  xi = xv(:,i);  invCi = inv(Ci);  Caccu = Caccu + invCi;  xaccu = xaccu + invCi*xi;end;% ReturnCwm = inv(Caccu);     % weighted covariance matrixxwm = Cwm*xaccu;      % weighted mean

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?