📄 xhmatall.m
字号:
% xhmatall.m
% Scope: This Matlab program tests the construction of the H matrix (based
% on line-of-sight, baro and clock measurements). The following
% macros are tested: hmat, hmatb, hmatc and hmatbc.
% Usage: xhmatall
% Inputs: - name of the input file containing ECEF satellite position
% - name of the input file containing ECEF user position
% - name of the output file, if the selection to store the data is
% made
% Remark: At least 4 measurements are required for the construction of H
% matrix.
% Outputs: - results stored into the output file or displayed on screen
% External Matlab macros used: hmat, hmatb, hmatc, hmatbc.
% Last update: 06/14/008
% Copyright (C) 1997-00 by LL Consulting. All Rights Reserved.
clear
yes = 'y';
% Specify the satellite ECEF position
disp(' ');
f1 = input('Specify the input filename for ECEF satellite position --> ','s');
tt = load(f1);
[nrowsv,ncolsv] = size(tt);
if (nrowsv < 2) | (ncolsv ~= 3)
error('XHMATALL - Error: check the input data for satellites position');
end
svpos = tt;
nrowsv1 = nrowsv + 1;
nrowsv2 = nrowsv + 2;
% Specify the user ECEF position
disp(' ');
f2 = input('Specify the input filename for ECEF user position --> ','s');
ttt = load(f2);
[nrowu,ncolu] = size(ttt);
if (nrowu ~= 1) | (ncolu ~= 3)
error('XHMATALL - Error: check the input data for user position');
end
upos = ttt;
% Specify the name of the output file
disp(' ');
answer1 = input('Do you want to save the results? (y/n)[n] ','s');
disp(' ');
if (strcmp(answer1,yes) == 1)
f3 = input('Specify the output filename --> ','s');
else
f3 = 1; % output to the screen
end
% Store/display the input data
fprintf(f3,'************************* Input data ************************');
fprintf(f3,'*************\n\n');
fprintf(f3,'ECEF satellites position (in meters): \n');
for kk = 1:nrowsv
fprintf(f3,'SV#%2.0f --> ',kk);
for k = 1:3
fprintf(f3,'%20.10f ',svpos(kk,k));
end
fprintf(f3,'\n');
end
fprintf(f3,'\n');
fprintf(f3,'ECEF user position (in meters): \n');
for k = 1:3
fprintf(f3,'%20.10f',upos(k));
end
fprintf(f3,'\n\n');
fprintf(f3,'************************* Output data **********************');
fprintf(f3,'*************\n\n');
% Construction of the H matrix based on line-of-sight measurements
fprintf(f3,'H matrix based on line-of-sight measurements : \n');
[xoutput,ier] = hmat(svpos,upos);
if ier == 0
for kk = 1:nrowsv
for k = 1:4
fprintf(f3,'%15.10f',xoutput(kk,k));
end
fprintf(f3,'\n');
end
fprintf(f3,'\n\n');
else
fprintf(f3,'\n ier = %2.0f, measurements dimension < 4\n\n',ier);
end
% Construction of the H matrix based on line-of-sight and baro measurements
fprintf(f3,'H matrix based on line-of-sight and baro measurements : \n');
[xoutput,ier] = hmatb(svpos,upos);
if ier == 0
for kk = 1:nrowsv1
for k = 1:4
fprintf(f3,'%15.10f',xoutput(kk,k));
end
fprintf(f3,'\n');
end
fprintf(f3,'\n\n');
else
fprintf(f3,'\n ier = %2.0f, measurements dimension < 4\n\n',ier);
end
% Construction of the H matrix based on line-of-sight and clock measurements
fprintf(f3,'H matrix based on line-of-sight and clock measurements : \n');
[xoutput,ier] = hmatc(svpos,upos);
if ier == 0
for kk = 1:nrowsv1
for k = 1:4
fprintf(f3,'%15.10f',xoutput(kk,k));
end
fprintf(f3,'\n');
end
fprintf(f3,'\n\n');
else
fprintf(f3,'\n ier = %2.0f, measurements dimension < 4\n\n',ier);
end
% Construction of the H matrix based on line-of-sight, baro, and clock
% measurements
fprintf(f3,'H matrix based on line-of-sight, baro and clock measurements');
fprintf(f3,': \n');
[xoutput,ier] = hmatbc(svpos,upos);
if ier == 0
for kk = 1:nrowsv2
for k = 1:4
fprintf(f3,'%15.10f',xoutput(kk,k));
end
fprintf(f3,'\n');
end
fprintf(f3,'\n\n');
else
fprintf(f3,'\n ier = %2.0f, measurements dimension < 4\n\n',ier);
end
fprintf(f3,'************************************************************');
fprintf(f3,'*************\n');
disp(' ');
disp('End of the program XHMATALL.M ');
disp(' ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -