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

📄 xdop.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                             xdop.m
%  Scope:   This MATLAB program computes dilution of precision (DOP) quantities 
%           when at least three line-of-sight unit vectors are specified by 
%           using macro DOP1.M or macro DOP2.M when four line-of-sight unit 
%           vectors are specified.
%  Usage:   xdop
%  Inputs:  - name of the output file containing the results; the default is 
%             the display on screen
%           - selection of the macro to be used  (dop1 or dop2)
%           - name of the input file containing line-of-sight unit vectors,
%             e.g. geom7.dat; each row contains a line-of-sight unit vector
%  Outputs: - input/output data stored on the selected output file or
%             displayed on screen
%  Remark : When less than four line-of-sight unit vectors are specified
%           the computation is not fully significant, and it is conducted
%           by using a pseudoinverse matrix instead of an inverse matrix.
%  External Matlab macros used:  dop1, dop2
%  Last update: 02/01/01
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

clear  
yes = 'y';
disp('  ');

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

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

%  Select the macro to be used

disp('Select the macro to be used: ');
disp(' -->  1   for  dop1.m  (when at least 3 LOS measurements) ');
disp(' -->  2   for  dop2.m  (when only 4 LOS measurements)   ');
kmet = input('Make selection --> ');
disp('  ');
if  ~((kmet == 1) | (kmet == 2))
   disp('Selection is incorrect');
   disp('  ');
   break;
end   
aa = ['*****   Results from the macro DOP'  num2str(kmet)  '.m   *****']; 

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 - XDOP; the input data file does not have 3 columns');
      disp('  ');
      break;
   end
   if  nrow < 3
      disp('  ');
      disp('Error - XDOP; the input data file has less than 3 rows');
      disp('  ');
      break;
   elseif  (nrow ~= 4) & (kmet ==2)
      disp(' ');
      disp('Error - XDOP; number of row ~= 4, when using DOP2.M');
      disp('  ');
      break;
   end

%  Compute DOP quantities

   if (kmet == 1)
      dops = dop1(tt);
   else
      dops = dop2(tt);
   end 

%  Save input data and results into an external file, or dispay 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%s\n\n',aa);
   fprintf(f2,'Geometric Dilution of Precision (GDOP)  = %9.4f\n',dops(1));
   fprintf(f2,'Position Dilution of Precision (PDOP)   = %9.4f\n',dops(2));  
   fprintf(f2,'Horizontal Dilution of Precision (HDOP) = %9.4f\n',dops(3));  
   fprintf(f2,'Vertical Dilution of Precision (VDOP)   = %9.4f\n',dops(4));  
   fprintf(f2,'Time Dilution of Precision (TDOP)       = %9.4f\n',dops(5));  
   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 program  XDOP ');
disp('  ');

⌨️ 快捷键说明

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