Mercurial > forge
changeset 5671:a4e8c00c8047 octave-forge
replace global with persistent variable
author | schloegl |
---|---|
date | Fri, 22 May 2009 12:53:31 +0000 |
parents | 503f32effbf7 |
children | 70ed4ab7ab5f |
files | extra/NaN/inst/flag_implicit_significance.m extra/NaN/inst/flag_implicit_skip_nan.m |
diffstat | 2 files changed, 31 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/NaN/inst/flag_implicit_significance.m Fri May 22 12:48:17 2009 +0000 +++ b/extra/NaN/inst/flag_implicit_significance.m Fri May 22 12:53:31 2009 +0000 @@ -1,4 +1,4 @@ -function DIM=flag_implicit_significance(i) +function alpha=flag_implicit_significance(i) % The use of FLAG_IMPLICIT_SIGNIFICANCE is in experimental state. % flag_implicit_significance might even become obsolete. % @@ -14,7 +14,7 @@ % flag_implicit_significance(0.01) % sets the alpha-level for the significance test % -% DIM = flag_implicit_significance() +% alpha = flag_implicit_significance() % gets default alpha % % flag_implicit_significance(alpha) @@ -26,11 +26,16 @@ % features: % - compatible to Matlab and Octave % -% see also: CORRCOEF +% see also: CORRCOEF, PARTCORRCOEF +% $Id$ +% Copyright (C) 2000-2002,2009 by Alois Schloegl <a.schloegl@ieee.org> +% This function is part of the NaN-toolbox +% http://hci.tu-graz.ac.at/~schloegl/matlab/NaN/ +% % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by -% the Free Software Foundation; either version 2 of the License, or +% the Free Software Foundation; either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, @@ -41,10 +46,8 @@ % You should have received a copy of the GNU General Public License % along with this program; If not, see <http://www.gnu.org/licenses/>. -% Version 2.99; 24 Aug 2002 -% Copyright (C) 2000-2002 by Alois Schloegl <a.schloegl@ieee.org> -global FLAG_implicit_significance; +persistent FLAG_implicit_significance; DEFAULT_ALPHA = 0.01; %%% check whether FLAG was already defined @@ -59,6 +62,6 @@ fprintf(2,'Warning: flag_implicit_significance is in an experimental state\n'); fprintf(2,'It might become obsolete.\n'); FLAG_implicit_significance = i; -end; +end; -DIM = FLAG_implicit_significance; +alpha = FLAG_implicit_significance;
--- a/extra/NaN/inst/flag_implicit_skip_nan.m Fri May 22 12:48:17 2009 +0000 +++ b/extra/NaN/inst/flag_implicit_skip_nan.m Fri May 22 12:53:31 2009 +0000 @@ -20,33 +20,33 @@ % STATISTIC, STD, VAR, ZSCORE etc. % % The mode is stored in the global variable FLAG_implicit_skip_nan -% It is recommended to use flag_implicit_skip_nan(1) as default and -% flag_implicit_skip_nan(0) should be used for exceptional cases only. -% This feature might disappear without further notice, so you should really not +% It is recommended to use flag_implicit_skip_nan(1) as default and +% flag_implicit_skip_nan(0) should be used for exceptional cases only. +% This feature might disappear without further notice, so you should really not % rely on it. -% This program is free software; you can redistribute it and/or modify -% it under the terms of the GNU General Public License as published by -% the Free Software Foundation; either version 3 of the License, or -% (at your option) any later version. -% -% This program is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -% GNU General Public License for more details. -% -% You should have received a copy of the GNU General Public License -% along with this program; if not, write to the Free Software -% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + % $Id$ -% Copyright (C) 2001-2003,2009 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 2001-2003,2009 by Alois Schloegl <a.schloegl@ieee.org> % This function is part of the NaN-toolbox % http://hci.tu-graz.ac.at/~schloegl/matlab/NaN/ -global FLAG_implicit_skip_nan; +persistent FLAG_implicit_skip_nan; if strcmp(version,'3.6'), FLAG_implicit_skip_nan=(1==1); end; %% hack for the use with Freemat3.6