📄 xsvsel.m
字号:
% xsvsel.m
% Scope: This MATLAB program executes the selection of 4, 5 or 6 satel-
% lites based on minimum geometric dilution of precision (GDOP)
% from all possible sets available. For the selected set of 4, 5
% or 6 satellites, and all-in-view, the computed dilution-of-
% precision (DOP) values are outputted.
% Usage: xsvsel
% Inputs: - name of the input filename; the default is xsvsel1.dat
% - name of the output filename or display the results on screen
% - number of satellites to be selected
% Outputs: - number of satellites available
% - number of satellites to be used
% - indices of the selected satellites
% - dilution-of-precision (DOP) values for the selected satellites
% set
% External Matlab macros used: svsel4, svsel5, svsel6, dop1
% Last update: 06/14/00
% Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.
clear
yes = 'y';
% Read the input data file
disp(' ');
disp('Enter input filename - the default is datafile xsvsel1.dat');
disp(' ');
answer1 = input('Do you want to use the default datafile? (y/n)[n] --> ','s');
disp(' ');
if (strcmp(answer1,yes) == 1)
f1 = 'xsvsel1.dat';
else
f1 = input('Specify the input filename (with extension) --> ','s');
disp(' ');
end
g = load(f1);
[nrow,ncol] = size(g);
if ncol ~= 3
disp(' ');
clear xsvsel1.dat % when xsvsel.dat is selected as an input datafile
error('Error 1 - XSVSEL; the input data file does not have 3 columns');
end
% Enter the name of the output data file
answer2 = input('Do you want to save the data (default, on screen)? (y/n)[n] --> ','s');
disp(' ');
if (strcmp(answer2,yes) == 1)
f2 = input('Specify the output filename, e.g. xsvsel1.out --> ','s');
disp(' ');
else
f2 = 1;
end
answer3 = 'y';
while (strcmp(answer3,yes) == 1)
clear index dops svind
index = input('Specify the number of satellites to be selected --> ');
disp(' ');
if index >= 7
index = nrow; % all-in-view case
end
% Select the best satellites
if index == 4
[hmat,dops,svind] = svsel4(g');
elseif index == 5
[hmat,dops,svind] = svsel5(g');
elseif index == 6
[hmat,dops,svind] = svsel6(g');
elseif index >= 7 % all-in-view case
dops = dop1(g);
for k = 1:index
svind(k) = k;
end
else
disp(' ');
clear xsvsel.dat % when xsvsel.dat is selected as an input datafile
error('Error 2 - XSVSEL ; check the number of LOSs or selection index');
end
% Record the results
fprintf(f2,'**************************************************************');
fprintf(f2,'\n\nNumber of satellites available = %3.0f\n',nrow);
fprintf(f2,'Number of satellites to be used = %3.0f\n',index);
fprintf(f2,'Indices of the selected satellites = ');
for k = 1:index
fprintf(f2,'%3.0f ',svind(k));
end
fprintf(f2,'\nGDOP = %10.3f',dops(1));
fprintf(f2,'\nPDOP = %10.3f',dops(2));
fprintf(f2,'\nHDOP = %10.3f',dops(3));
fprintf(f2,'\nVDOP = %10.3f',dops(4));
fprintf(f2,'\nTDOP = %10.3f\n\n',dops(5));
fprintf(f2,'**************************************************************');
fprintf(f2,'\n\n');
% Select another computation, if desired
answer3 = input('Do you want another selection? (y/n)[n] --> ','s');
disp(' ');
end
clear xsvsel.dat % when xsvsel.dat is selected as an input data file
disp('End of the program XSVSEL');
disp(' ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -