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

📄 xambig.m

📁 功能极全的GPS开发工具箱
💻 M
字号:
%                             xambig.m
%  Scope:   This MATLAB program generates ambiguity numbers for a specified number 
%           of satellites.
%  Usage:   xambig
%  Inputs:  - from keyboard the user should enter the following data: 
%             - maximum number of satellites used, nrsv (default is 32)
%             - random number seed value (default is 0)
%             - selection of the storage data file
%                - ambfile.mat (default)
%                - selected name for ASCII data file
%                - none, no storage
%  Outputs: - output file storing the ambiguity number for the number of selected 
%             satellites: mat-file ambfile.mat or defined ASCII data file; the output
%             ambig array has one row and nrsv columns
%           - display the ambiguity values for the number of selected satellites
%  Last update:  09/30/00
%  Copyright (C) 1999-00 by LL Consulting. All Rights Reserved.

clear
yes = 'y';

disp('  ');
nrsv = input('Enter maximum number of satellites used, nrsv (default is 32) -- >  ');
if isempty(nrsv)
   nrsv = 32;
end   
disp('  ');

%  Selection of random number seed

xseed = input('Enter random number seed value (default is 0.)  -- >  ');
if isempty(xseed)
   xseed = 0.;
end   
disp('  ');
randn('seed',xseed);

%  Generate the ambiguity data

for k = 1:nrsv
   svid = nrsv;
   ambig(k) = fix(randn(1)*svid*1.e+6);
end   

%  Store the ambiguity generated data into ambfile.mat or selected ASCII data file

disp('Specify where you want to save the generated data ');
disp('     Enter  1   for the file ambfile.mat');
disp('     Enter  2   for the ASCII data file to be selected');
disp('     Enter  3   for NOT saving');
answer1 = input('Enter your selection  (default is 1) -- >  ');
if isempty(answer1)
   answer1 = 1;
end   
if  (answer1 == 1)
   save   ambfile  ambig
elseif  (answer1 == 2)
   f2 = input('Enter the ambiguity ASCII data file (with extension) -- > ','s');
      for  kk = 1:nrsv
         fprintf(f2,'%14.7e \n',ambig(k));
      end
else
    fprintf('\nThe generated data is NOT saved\n');
end
 
 %  Execute plots of generated multipath data
 
disp('  ');
answer2 = input('Display the generated ambiguity data? (y/n)[y] ');
disp('  ');
if isempty(answer2)
   answer2 = yes;
end  
if strcmp(answer2,yes)
   for k = 1:nrsv
      fprintf('For svid = %2d, the ambiguity = %d\n',k,ambig(k));
   end
end
disp('  ');
disp('End of the program  XAMBIG ');
disp('  ');

⌨️ 快捷键说明

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