📄 wls.m
字号:
function polyestim = wls(x,y,w,order)
%
% Calculates polynomial estimates using weighted least squares fitting.
% x: Time coordinates of the measurements.
% y: Instananeous range measurements.
% w: Weight for the measurements. In this algorithm, the magnitude of
% the segment is considered as weight.
% [m,n]=size(y); if m == 1 m = n; n = 1; y = y(:); end [mm,nn]=size(x); if mm == 1 mm = nn; nn = 1; x = x(:); end xvect=[]; for ord = 0:order xpower=x.^ord; xvect=[xvect,xpower]; end wmat=diag(w); polyest=inv(xvect'*wmat*xvect)*xvect'*wmat*y; polyestim=flipud(polyest);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -