Mercurial > forge
changeset 9423:1aba1694a5bd octave-forge
correct shirt-circuit logical operators
author | schloegl |
---|---|
date | Fri, 10 Feb 2012 10:18:00 +0000 |
parents | 48fcba9e9a29 |
children | 4d06b788e7d2 |
files | extra/tsa/inst/aarmam.m extra/tsa/inst/arcext.m extra/tsa/inst/arfit2.m extra/tsa/inst/mvar.m extra/tsa/inst/rc2poly.m extra/tsa/inst/rmle.m extra/tsa/inst/selmo.m |
diffstat | 7 files changed, 39 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/tsa/inst/aarmam.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/aarmam.m Fri Feb 10 10:18:00 2012 +0000 @@ -40,10 +40,14 @@ % ISBN 3-8265-7640-3 Shaker Verlag, Aachen, Germany. % % More references can be found at -% http://www.dpmi.tu-graz.ac.at/~schloegl/publications/ +% http://pub.ist.ac.at/~schloegl/publications/ % $Id$ -% Copyright (C) 1998-2002,2008 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1998-2002,2008,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ % % 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 @@ -106,7 +110,7 @@ return; end; end; -if (p<0) | (q<0) | (round(p)~=p) | (round(q)~=q), +if (p<0) || (q<0) || (round(p)~=p) || (round(q)~=q), fprintf(2,'Error AARMAM: p and q must be positive integers\n'); return; end;
--- a/extra/tsa/inst/arcext.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/arcext.m Fri Feb 10 10:18:00 2012 +0000 @@ -22,7 +22,11 @@ % W.S. Wei "Time Series Analysis" Addison Wesley, 1990. % $Id$ -% Copyright (C) 1998-2003,2008 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1998-2003,2008,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ % % 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 @@ -48,7 +52,7 @@ fprintf(2,'Warning ARCEXT: Number of elements is different than a triangular matrix\n'); end; -if (K~=P) & (lc~=K*(K+1)/2), +if (K~=P) && (lc~=K*(K+1)/2), [AR,RC,PE]=rc2ar(MX(:,(1:P).*(2:P+1)/2)); else AR = MX(:,P*(P-1)/2+(1:P));
--- a/extra/tsa/inst/arfit2.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/arfit2.m Fri Feb 10 10:18:00 2012 +0000 @@ -34,7 +34,11 @@ % of multivariate autoregressive models. ACM-Transactions on Mathematical Software. 27, (Mar.), 58-65. % $Id$ -% Copyright (C) 1996-2005,2008 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1996-2005,2008,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ % 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 @@ -51,7 +55,7 @@ %%%%% checking of the input arguments was done the same way as ARFIT -if (pmin ~= round(pmin) | pmax ~= round(pmax)) +if (pmin ~= round(pmin) || pmax ~= round(pmax)) error('Order must be integer.'); end if (pmax < pmin)
--- a/extra/tsa/inst/mvar.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/mvar.m Fri Feb 10 10:18:00 2012 +0000 @@ -86,9 +86,9 @@ % see also: MVFILTER, MVFREQZ, COVM, SUMSKIPNAN, ARFIT2 % $Id$ -% Copyright (C) 1996-2006 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1996-2006,2011,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> % This is part of the TSA-toolbox. See also -% http://hci.tugraz.at/schloegl/matlab/tsa/ +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ % http://octave.sourceforge.net/ % http://biosig.sourceforge.net/ % @@ -921,7 +921,7 @@ else Mode0 = rem(Mode,100); - if ((Mode0>=10) & (Mode0<20)), + if ((Mode0 >= 10) && (Mode0 < 20)), Mode0 = 1; end;
--- a/extra/tsa/inst/rc2poly.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/rc2poly.m Fri Feb 10 10:18:00 2012 +0000 @@ -6,7 +6,11 @@ % % $Id$ -% Copyright (C) 1998-2002,2008 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1998-2002,2008,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ % % 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 @@ -22,7 +26,7 @@ % along with this program. If not, see <http://www.gnu.org/licenses/>. -if nargout>1 & nargin<2 +if nargout>1 && nargin<2 fprintf('Zero-lag autocorrelation, R0 not specified\n') return; end;
--- a/extra/tsa/inst/rmle.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/rmle.m Fri Feb 10 10:18:00 2012 +0000 @@ -61,7 +61,7 @@ ti=-(N*c1)/((N-1)*d1); raices=roots([coef3 coef2 coef1 ti]); for o=1:3 - if raices(o)>-1 & raices(o)<1 + if raices(o)>-1 && raices(o)<1 a_aux(2,1)=raices(o); b_aux(p+1,1)=raices(o); end @@ -80,7 +80,7 @@ tire=-(N*ck)/((N-k)*dk); raices=roots([coef3re coef2re coef1re tire]); for o=1:3 - if raices(o,1)>-1 & raices(o,1)<1 + if raices(o,1)>-1 && raices(o,1)<1 MLE(o,1)=((1-raices(o)^2)^(k/2))/(((e_aux(k-1)+2*ck*raices(o)+dk*(raices(o)^2))/N)^(N/2)); end end
--- a/extra/tsa/inst/selmo.m Fri Feb 10 09:56:25 2012 +0000 +++ b/extra/tsa/inst/selmo.m Fri Feb 10 10:18:00 2012 +0000 @@ -39,7 +39,11 @@ % % $Id$ -% Copyright (C) 1997-2002,2008 by Alois Schloegl <a.schloegl@ieee.org> +% Copyright (C) 1997-2002,2008,2012 by Alois Schloegl <alois.schloegl@ist.ac.at> +% This is part of the TSA-toolbox. See also +% http://pub.ist.ac.at/~schloegl/matlab/tsa/ +% http://octave.sourceforge.net/ +% http://biosig.sourceforge.net/ % % 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 @@ -55,7 +59,7 @@ % along with this program. If not, see <http://www.gnu.org/licenses/>. [lr,lc]=size(e); -if (lr>1) & (lc>1), +if (lr>1) && (lc>1), p=zeros(lr+1,9)+NaN; else p=zeros(1,9)+NaN; @@ -74,8 +78,8 @@ M=lc-1; m=0:M; -e = e./e(:,ones(1,lc)); - +e = e./e(:,ones(1,lc)); + for k=0:lr, if k>0, % E=e(k,:); @@ -138,5 +142,5 @@ % in case more than 1 minimum is found, the smaller model order is returned; p(k+1,:) = [optFPE(1), optAIC(1), optBIC(1), optSBC(1), optCAT(1), optMDL(1), optPHI(1), optJEW(1), optHAR(1)]; -end; +end; C=[FPE;AIC;BIC;SBC;MDL;CATcrit;PHI;JEW;HAR(:)']';