mgtlsr.m

来自「简单易懂」· M 代码 · 共 30 行

M
30
字号
function [m,dh] = mgtlsr(d,w,r)% MGTLSR - Global Total Least Squares misfit computation.% [M,DH] = MGTLSR(D,W,R) gives the GTLS misfit M and the GTLS% approximation DH of the data D by the model ker(R).%% See GTLS for the possible formats of W.% The computation is based on a transformation to a modified % TLS problem. As an alternative, see Corollary 2.11.[sd,N] = size(d);% Modify R and Dif length(w(:)) == sd % EWGTLS  w  = w(:); % make it a column vector  sw = sqrt(w);  r  = r ./ sw(:,ones(1,size(r,1)))';  d  = sw(:,ones(1,N)) .* d; else % GTLS  sw = chol(w);  r  = r / sw;  d  = sw * d;end% Compute the TLS misfit for the modified R and Dif nargout == 1  m = mtlsr(d,r);else  [m,dh] = mtlsr(d,r);end

⌨️ 快捷键说明

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