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

📄 xslope.m

📁 GPS TOOLBOX包含以下内容: 1、GPS相关常量和转换因子; 2、角度变换; 3、坐标系转换: &#61656 点变换; &#61656 矩阵变换; &#61656 向量变换
💻 M
字号:
%                             xslope.m
%  Scope:   This MATLAB program determines slope_max and delta_h_max for the
%           Receiver Autonomous Integrity Monitoring (RAIM) baseline standard
%           algorithm (constant alarm rate algorithm) [1] for a specified set
%           of input data.
%  Usage:   xslope
%  Inputs:  - name of the data file containing line-of-sight unit vectors,
%             each vector is stored in another row (it should be 3 columns);
%             a set of default values is specified
%           - name of the output file (optional); the default is the screen
%  Outputs: - values of the selected input data set
%           - computed slope_max and delta_h_max
%           - computed error = (slope_max - delta_h_max * 
%		                    sqrt(number of measurements - 4))
%  References: 
%           [1] Brown, R. G., A baseline RAIM scheme and a note on the
%               equivalence of three RAIM methods. Proceedings of the National
%               Technical Meeting, Institute of Navigation, San Diego, CA,
%               Jan. 27-29, 1992, pp. 127-137.
%           [2] Brown, A. K., Sturza, M. A., The effect of geometry on 
%               integrity monitoring performance. The Institute of Navigation
%               46th Annual Meeting, June 1990, pp. 121-129. 	
%  Remark:  The following related formula may be used
%               slopemax = delta_h_max * sqrt(number of measurements - 4)
%  External Matlab macros used:  dhmax, slopemax
%  Last update:  07/31/00
%  Copyright (C) 1997-00 by LL Consulting. All Rights Reserved.

clear 
yes = 'y';

%  Enter line-of-sight unit vectors

disp('  ');
disp('Enter line-of-sight unit vectors (at least 5)');
answer1 = input('Do you want to use the default data? (y/n)[y] ','s');
if isempty(answer1)
   answer1 = yes;
end   
if (strcmp(answer1,yes) == 1)
    g  = [ 7.787995e-002  -6.017930e-001   7.947552e-001
           1.730016e-001  -9.665970e-001  -1.891052e-001
          -8.457427e-001  -4.893909e-001  -2.126402e-001
          -5.385451e-001  -2.338803e-001   8.094870e-001
           4.345836e-001  -7.366578e-001  -5.181432e-001
           7.052152e-001  -5.433383e-001   4.554723e-001 
          -8.973768e-001   3.366878e-001   2.852302e-001 ];
else
   disp('  ');
   ff = input('Specify the input filename (with extension) --> ','s');
   g = load(ff);
end
[nrow,ncol] = size(g);

if nrow < 5
   disp('  ');
   disp('Error - XSLOPE; there are fewer than 5 line-of-sights');
   disp('  ');
   return
end

%  Save computed results into an external file

disp('  ');
disp('Enter the output desired (data file or on screen)');
answer2 = input('Do you want to display the results on screen? (y/n)[y] ','s');
if isempty(answer2)
   answer2 = yes;
end   
disp('  ');
if (strcmp(answer2,yes) == 1)
   f2 = 1;
else
   f2 = input('Specify the output filename (with extension) --> ','s');
end

%  Determine slope_max and delta_h_max

x1 = slopemax(g);
x2 = dhmax(g);

%  Display/save the results

fprintf(f2,'**************************************************************\n');
fprintf(f2,'\n*****   Input data   ****** \n\n');

for k = 1:nrow
   fprintf(f2,'LOS # %2.0f --> %16.7f %16.7f %16.7f\n',k,g(k,1:3));
end

fprintf(f2,'\n*****   Results by using XSLOPE   ****** \n\n');

fprintf(f2,'Slope_max   --> %16.7f\n',x1);
fprintf(f2,'Delta_h_max --> %16.7f\n\n',x2);

% Verification:  (slope_max - delta_h_max * sqrt(number of measurements - 4))

dif = x1 - x2 * sqrt(nrow - 4);
fprintf(f2,'Verification: Difference (error) --> %16.10f\n\n',dif);

fprintf(f2,'**************************************************************\n');

disp('  ');
disp('End of the program  XSLOPE.M ');
disp('  ');

⌨️ 快捷键说明

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