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

📄 xcepvep.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                                xcepvep.m
%  Scope:  This MATLAB program computes the value of circular error probable
%          (CEP) or vertical error probable (VEP) by using m-macro cep or
%          m-macro vep.
%  Usage:  xcepvep
%  Inputs:   - name of the input file containing x-y error data for cep 
%              computation and x error data for vep computation; first column
%              contains the x axis error data while the second column contains
%              the y axis error data
%            - name of the output file containing the results, optional
%  Outputs:  - input/output data stored on the selected output file or
%              displayed on screen 
%  External Matlab macros used:  cep, vep
%  Last update:  06/26/00
%  Copyright (C) 1996-00 by LL Consulting. All Rights Reserved.

clear

yes = 'y';
mtitle = 'Choose a computation';
select1 = 'Circular Error Probable (CEP)';
select2 = 'Vertical Error Probable (VEP)';
select3 = 'Exit program';
answer2 = 'y';
disp('  ');

aa = 'Specify the input data filename for the x-y errors, e.g. xcepvep1.dat  -->  ';
bb = 'Specify the input data filename for the x errors, e.g. xcepvep1.dat  -->  ';
while (strcmp(answer2,yes) == 1)
   comp = menu(mtitle,select1,select2,select3);

   if comp == 1

%  Execute the computation of CEP
      f1 = input(aa,'s');
      tt = load(f1);
      [nrow,ncol] = size(tt);
      if  ncol ~= 2
         disp('XCEPVEP - Error: check the input data ');
         disp('  ');
         return
      end
      x = tt(1:nrow,1);
      y = tt(1:nrow,2);

      xycep = cep(x,y);

%     Save computed results into an external file or displayed on screen

      disp(' ');
      answer3 = input('Do you want to save the results (y/n)[n] ? --> ','s');
      disp(' ');
      if (strcmp(answer3,yes) == 1)
         f2 = input('Specify the output filename  -->  ','s');
      else
         f2 = 1;      %  output to the screen
      end
      
      fprintf(f2,'Results for the following input data \n\n');
      fprintf(f2,'           x                 y   \n');
      for k = 1:nrow
         fprintf(f2,' %15.7f   %15.7f\n',x(k),y(k));
      end
      fprintf(f2,'\nCEP =  %15.7f\n\n',xycep);
      
   elseif comp == 2

%  Execute the computation of VEP

      f1 = input(bb,'s');
      tt = load(f1);
      [nrow,ncol] = size(tt);
      xcol = 1;
      if  ncol ~= 1
         xcol = input('Select the column number --> ');
         if  (xcol > ncol)
            disp('XCEPVEP - Error: check the column number selection ');
            disp('  ');
            return
         end
      end
      x = tt(1:nrow,xcol);

      xvep = vep(x);

%     Save computed results into an external file or displayed on screen

      disp(' ');
      answer4 = input('Do you want to save the results (y/n)[n] --> ?  ','s');
      disp(' ');
      if (strcmp(answer4,yes) == 1)
         f2 = input('Specify the output filename  -->  ','s');
      else
         f2 = 1;      %  output to the screen
      end
      
      fprintf(f2,'Results for the following input data \n\n');
      fprintf(f2,'           x                  \n');
      for k = 1:nrow
         fprintf(f2,' %15.7f  \n',x(k));
      end
      fprintf(f2,'\nVEP =  %15.7f\n\n',xvep);
      
   elseif comp == 3
      clear xcepvep;
      break
   else
      clear xcepvep;
      disp('Error XCEPVEP;  check the index of the selection');
      disp('  ');
      return
   end
   
%  Check if another computation is needed

   answer1 = input('Do you want to make another computation? (y/n)[y] --> ','s');
   if  isempty(answer1)
      answer1 = 'y';
   end
   disp('  ');
   if (strcmp(answer1,yes) == 1)
      if  isempty(answer2)
         answer2 = 'y';
      end
   else
      answer2 = 'n';
   end

end

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

⌨️ 快捷键说明

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