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

📄 xwdop.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                             xwdop.m
%  Scope:   This MATLAB program computes weighted dilution of precision (WDOP)
%           quantities when at least three line-of-sight unit vectors are
%           specified by using macro WDOP1.m or WDOP2.m four line-of-sight unit 
%           vectors are specified.
%  Usage:   xwdop
%  Inputs:  - name of the output file containing the results; the default is 
%             the diplay on the screen
%           - selection of the macro to be used (wdop1 or wdop2)
%           - name of the input file containing line-of-sight unit vectors,
%             e.g. geom7.dat; each row contains a line-of-sight unit vector
%           - weighting factors (from keyboard) for each line-of-sight
%  Outputs: - input/output data stored on the selected output file or
%             displayed on screen
%  External Matlab macros used:  wdop1, wdop2
%  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; 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  wdop1.m  (when at least 3 LOS measurements) ');
disp(' -->  2   for  wdop2.m  (when only 4 LOS measurements)   ');
kmet = input('Make selection --> ');
disp('  ');
if  ~((kmet == 1) | (kmet == 2))
   disp('Selection is incorrect');
   disp('  ');
   break;
end   
att = ['*****   Results from the macro WDOP'  num2str(kmet) ];
att = [att  '.m   *******************']; 

answer = 'y';
while (strcmp(answer,yes) == 1)
   clear  tt dops
   f1 = input('Specify the input filename (with extension) --> ','s');

%  Read the input data file

   tt = load(f1);
   [nrow,ncol] = size(tt);

   if  ncol ~= 3
      disp('  ');  
      disp('Error - XWDOP; the input data file does not have 3 columns');
      disp('  ');
      break;
   end
   if  nrow < 3
      disp('  ');
      disp('Error - XWDOP; the input data file has less than 3 rows');
      disp('  ');
      break;
   elseif  (nrow ~= 4) & (kmet ==2)
      disp(' ');
      disp('Error - XWDOP; number of row ~= 4, when using WDOP2.M');
      disp('  ');
      break;
   end

%  Enter the weighting factors
   
   disp(' ');
   aa = 'Enter the weighting factor for LOS # ';
   for k = 1:nrow
      aaa = [aa num2str(k) ': ']; 
      wf(k) = input(aaa);
   end
      
%  Compute WDOP quantities
   
   if (kmet == 1)
      wdops = wdop1(tt,wf);
   else
      wdops = wdop2(tt,wf);
   end 

%  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 --> %12.7f\n',wf(k));
   end
   fprintf(f2,'\n%s \n\n',att);
   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\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  XWDOP ');
disp('  ');

⌨️ 快捷键说明

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