📄 hmat.m
字号:
% hmat.m
% Scope: This MATLAB macro constructs the H matrix (based on line-of-sight
% measurements), when the user's position and the satellites position
% are known.
% Usage: [houtput,ier] = hmat(svpos,upos)
% Description of parameters:
% svpos - input, four ECEF satellite positions, each row contains
% the three component for a satellite, all components are
% in meters
% upos - input/output, ECEF user's position, the components are
% in meters
% houtput - output, H matrix (based on line-of-sight measurement)
% ier - output, index of error
% = 0 no error
% = 1 error, see the measurement dimensions
% Remark: At least 4 measurements are required for the construction of H
% matrix.
% Last update: 06/14/00
% Copyright (C) 1997-00 by LL Consulting. All Rights Reserved.
function [houtput,ier] = hmat(svpos,upos)
ier = 0;
[nrow,ncol] = size(svpos);
if (nrow < 4) | (ncol ~= 3)
ier = 1;
houtput = 0;
return;
end
% Form the matrix H (based on line-of-sight measurements)
for k = 1:nrow
temp(1) = upos(1) - svpos(k,1);
temp(2) = upos(2) - svpos(k,2);
temp(3) = upos(3) - svpos(k,3);
tempt = sqrt(temp(1)*temp(1) + temp(2)*temp(2) + temp(3)*temp(3));
for kk = 1:3
houtput(k,kk) = temp(kk)/tempt;
end
houtput(k,4) = 1.;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -