⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xgdopv.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                             xgdopv.m
%  Scope:   This MATLAB program computes an approximate value for the geometric
%           dilution of precision (GDOP), when four line-of-sight unit vectors
%           are specified, by using an approximate geometric method [1].
%  Usage:   xgdopv
%  Inputs:  - name of the output file containing the results
%           - name of the input file containing line-of-sight unit vectors, e.g.
%             geom4.dat; each row contains a line-of-sight unit vector
%  Outputs: - input/output data stored on the selected output file or
%             displayed on screen
%  References: 
%           [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.
%  External Matlab macros used:  gdopv
%  Last update:  06/15/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

clear  
yes = 'y';

%  Save the generated data into a specified file if desired, the default is
%  the display on screen

disp(' ');
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 x
   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('Error1 - XGDOPV: the input data file does not have 3 columns');
      disp('  ');
      break;
   elseif  nrow ~= 4
      disp('  ');
      disp('Error2 - XGDOPV: check number of the unit line of sight vectors');
      disp('  ');
      break;
   end

%  Compute approximate GDOP 

   gdop = gdopv(tt);

%  Save input data and results into an external file or display on screen

   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));
   end
   fprintf(f2,'\n*****   Results from the macro XGDOPV.M   ***** \n\n');
   fprintf(f2,'Computed (approximate) GDOP is %15.6f\n',gdop);
   fprintf(f2,'\n*************************************************** \n');

%  Select another computation, if desired

   disp('  ');
   answer = input('Do you want another computation ? (y/n)[n] --> ','s');
   disp('  ');
end

disp('End of the program  XGDOPV');
disp('  ');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -