]> Creatis software - CreaPhase.git/blob - octave_packages/tsa-4.2.4/flag_implicit_samplerate.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / tsa-4.2.4 / flag_implicit_samplerate.m
1 function DIM=flag_implicit_samplerate(i)
2 % The use of FLAG_IMPLICIT_SAMPLERATE is in experimental state. 
3 % FLAG_IMPLICIT_SAMPLERATE might even become obsolete.
4 % Do not use it. 
5
6 % FLAG_IMPLICIT_SAMPLERATE sets and gets default mode for handling NaNs
7 % The default DIM argument is stored in the global variable FLAG_implicit_samplerate
8 % The idea is that the DIM-argument is not necessary. This might enable 
9 % more readable code. 
10
11 %   flag_implicit_samplerate(0) 
12 %       calculation along first non-singleton dimension
13 %   flag_implicit_samplerate(1) 
14 %       calculation along columns
15 %   flag_implicit_samplerate(2) 
16 %       calculation along rows
17
18 % DIM = flag_implicit_samplerate()
19 %       gets default mode
20 %
21 % flag_implicit_samplerate(DIM)
22 %       sets default DIM
23 %
24 % DIM = flag_implicit_samplerate(DIM)
25 %       gets and sets DIM 
26 %
27 % features:
28 % - compatible to Matlab and Octave
29 %
30 % see also: SINVEST1
31
32 %       $Id: flag_implicit_samplerate.m 5090 2008-06-05 08:12:04Z schloegl $
33 %       Copyright (C) 2000-2002,2008 by Alois Schloegl <a.schloegl@ieee.org>    
34 %
35 %    This program is free software: you can redistribute it and/or modify
36 %    it under the terms of the GNU General Public License as published by
37 %    the Free Software Foundation, either version 3 of the License, or
38 %    (at your option) any later version.
39 %
40 %    This program is distributed in the hope that it will be useful,
41 %    but WITHOUT ANY WARRANTY; without even the implied warranty of
42 %    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43 %    GNU General Public License for more details.
44 %
45 %    You should have received a copy of the GNU General Public License
46 %    along with this program.  If not, see <http://www.gnu.org/licenses/>.
47
48 global FLAG_implicit_samplerate;
49
50 %%% check whether FLAG was already defined 
51 if exist('FLAG_implicit_samplerate')~=1,
52         FLAG_implicit_samplerate = 1;
53 end;
54 if isempty(FLAG_implicit_samplerate),
55         FLAG_implicit_samplerate = 1;
56 end;
57
58 if nargin>0,
59         fprintf(2,'Warning: FLAG_IMPLICIT_SAMPLERATE is in an experimental state\n');
60         fprintf(2,'It might become obsolete.\n');
61         FLAG_implicit_samplerate = i; 
62 end;    
63
64 DIM = FLAG_implicit_samplerate;