📄 xwdopv.m
字号:
% xwdopv.m
% Scope: This MATLAB program computes the weighted dilution of precision
% (WDOP) quantities when four line-of-sight unit vectors and the
% corresponding weighting factors are specified, by using a geometric
% method [1].
% Usage: xwdopv
% Inputs: - name of the output file containing the results; the default is
% the display on screen
% - name of the input file containing line-of-sight unit vectors;
% each row contains a line-of-sight (LOS) unit vector
% - weighting factors (from keyboard) for each LOS
% Outputs: - input/output data stored on the selected output file or
% displayed on screen
% External Matlab macros used: wdopv
% Reference:
% [1] Massatt, P., Rudnick, K., Geometric formulas for dilution
% of precision calculations. Navigation, Journal of the
% Institute of Navigation, Vol. 37, No. 4, 1990-91, pp. 379-391.
% Last update: 06/15/00
% Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.
clear
yes = 'y';
disp(' ');
% Save the generated data into a specified file if desired
answer1 = input('Do you want to save the generated data? (y/n)[n] --> ','s');
disp(' ');
if isempty(answer1)
answer1 = 'no';
end
if strcmp(answer1,yes) == 1
f2 = input('Specify the output file name --> ','s');
disp(' ');
else
f2 = 1; % output to the screen
end
answer = 'y';
while (strcmp(answer,yes) == 1)
clear tt dops
f1 = input('Specify the input filename (with extension), e.g. geom4.dat --> ','s');
% Read the input data file
tt = load(f1);
[nrow,ncol] = size(tt);
if ncol ~= 3
disp(' ');
disp('Error 1 - XWDOPV; the input data file does not have 3 columns');
disp(' ');
break;
elseif nrow ~= 4
disp(' ');
disp('Error 2 - XWDOPV; the input data file does not have 4 rows');
disp(' ');
break;
end
% Enter the weighting factors from keyboard
disp(' ');
aa = 'Enter the weighting factor for LOS # ';
for k = 1:nrow
aaa = [aa num2str(k) ': '];
wf(k) = input(aaa);
end
disp(' ');
% Compute WDOP quantities
[wdops,ier] = wdopv(tt,wf);
% Save input data and results into an external file
fprintf(f2,'\n***** Input data ***************************************\n\n');
for k = 1:nrow
fprintf(f2,'LOS # %2.0f --> %12.7f %12.7f %12.7f\n',k,tt(k,1:3));
fprintf(f2,' with the weighting factor --> %16.7f\n',wf(k));
end
fprintf(f2,'\n***** Results from the macro XWDOPV.M ******************\n\n');
fprintf(f2,'Weighted Geometric Dilution of Precision (WGDOP) = %9.4f\n',...
wdops(1));
fprintf(f2,'Weighted Position Dilution of Precision (WPDOP) = %9.4f\n',...
wdops(2));
fprintf(f2,'Weighted Horizontal Dilution of Precision (WHDOP)= %9.4f\n',...
wdops(3));
fprintf(f2,'Weighted Vertical Dilution of Precision (WVDOP) = %9.4f\n',...
wdops(4));
fprintf(f2,'Weighted Time Dilution of Precision (WTDOP) = %9.4f\n',...
wdops(5));
fprintf(f2,'\n************************************************************\n\n');
% Select another computation, if desired
answer = input('Do you want another computation? (y/n)[n] --> ','s');
disp(' ');
end
disp('End of the program XWDOPV ');
disp(' ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -