Index: ../octave-forge/extra/graceplot/inst/alternatives/print.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/print.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/print.m (working copy) @@ -183,7 +183,7 @@ if (dot == 0) error ("print: no format specified"); else - dev = tolower(name(dot+1:length(name))); + dev = lower(name(dot+1:length(name))); endif else dev = devopt; Index: ../octave-forge/extra/graceplot/inst/alternatives/__plt__.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/__plt__.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/__plt__.m (working copy) @@ -43,18 +43,18 @@ unwind_protect - k = 1; - x = varargin{k++}; - nargs -= 2; + x = varargin{1}; + nargs = nargs-2; x_set = 1; y_set = 0; + k = 2; ## Gather arguments, decode format, and plot lines. - while (nargs-- > 0) - + while (nargs > 0) + nargs = nargs - 1; fmt = ""; - new = varargin{k++}; + new = varargin{k}; k=k+1; if (ischar (new)) if (! x_set) Index: ../octave-forge/extra/graceplot/inst/alternatives/legend.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/legend.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/legend.m (working copy) @@ -98,7 +98,7 @@ ## Test for strings if (ischar(str)) && (args == 1) - _str = tolower(deblank(str)); + _str = lower(deblank(str)); _replot = 1; switch _str case {"off", "hide"} Index: ../octave-forge/extra/graceplot/inst/alternatives/__grpltfmt__.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/__grpltfmt__.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/__grpltfmt__.m (working copy) @@ -33,7 +33,7 @@ error("Matrix must be real"); endif -settype = tolower(settype); +settype = lower(settype); switch settype case "xy" checktype(2, m); Index: ../octave-forge/extra/graceplot/inst/alternatives/__errcomm__.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/__errcomm__.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/__errcomm__.m (working copy) @@ -43,7 +43,7 @@ k = 1; data = cell(6,1); while (k <= nargs) - a = varargin{k++}; + a = varargin{k}; k=k+1; if (isvector (a)) a = a(:); elseif (ismatrix (a)) @@ -55,7 +55,7 @@ ndata = 1; data{ndata} = a; while (k <= nargs) - a = varargin{k++}; + a = varargin{k}; k=k+1; if (ischar (a)) __errplot__ (a, data{1:ndata}); break; @@ -69,7 +69,8 @@ if (size (a) != sz) error ("argument sizes do not match"); endif - data{++ndata} = a; + ndata = ndata + 1; + data{ndata} = a; if (ndata > 6) error ("too many arguments to a plot"); endif Index: ../octave-forge/extra/graceplot/inst/alternatives/axis.m =================================================================== --- ../octave-forge/extra/graceplot/inst/alternatives/axis.m (revision 7460) +++ ../octave-forge/extra/graceplot/inst/alternatives/axis.m (working copy) @@ -133,7 +133,7 @@ curr_axis = __current_axis__; elseif (ischar (ax)) - ax = tolower (ax); + ax = lower (ax); len = length (ax); ## 'matrix mode' to reverse the y-axis Index: ../octave-forge/extra/control-legacy/inst/rlocus.m =================================================================== --- ../octave-forge/extra/control-legacy/inst/rlocus.m (revision 7460) +++ ../octave-forge/extra/control-legacy/inst/rlocus.m (working copy) @@ -157,7 +157,7 @@ nroots = lden - 1; for ii = 1:ngain gain = gvec(ii); - rlpol(1:nroots,ii) = vec(sortcom (roots (den + gain*num))); + rlpol(1:nroots,ii) = reshape(sortcom (roots (den + gain*num)),[],1); endfor ## set smoothing tolerance @@ -202,7 +202,7 @@ ngain1 = length (gvec); for ii = (ngain+1):ngain1 gain = gvec(ii); - rlpol(1:nroots,ii) = vec(sortcom (roots (den + gain*num))); + rlpol(1:nroots,ii) = reshape(sortcom (roots (den + gain*num)),[],1); endfor [gvec, idx] = sort (gvec); @@ -241,7 +241,8 @@ sigma_A = (sum(olpol) - sum(olzer))/n_A; for i_A=0:n_A-1 phi_A = pi*(2*i_A + 1)/n_A; - args{1,++kk} = [sigma_A sigma_A+len_A*cos(phi_A)]; + kk = kk + 1; + args{1,kk} = [sigma_A sigma_A+len_A*cos(phi_A)]; args{2,kk} = [0 len_A*sin(phi_A)]; if (i_A == 1) args{3,kk} = "k--;asymptotes;"; @@ -252,7 +253,8 @@ endif # locus next for ii = 1:rows(rlpol) - args{1,++kk} = real (rlpol (ii,:)); + kk = kk + 1; + args{1,kk} = real (rlpol (ii,:)); args{2,kk} = imag (rlpol (ii,:)); if (ii == 1) args{3,kk} = "b-;locus;"; @@ -261,23 +263,28 @@ endif endfor # poles and zeros last - args{1,++kk} = real (olpol); + kk = kk + 1; + args{1,kk} = real (olpol); args{2,kk} = imag (olpol); args{3,kk} = "rx;open loop poles;"; if (! isempty (rlzer)) - args{1,++kk} = real (rlzer); + kk += 1; + args{1,kk} = real (rlzer); args{2,kk} = imag (rlzer); args{3,kk} = "go;zeros;"; endif set (gcf,"visible","off"); hplt = plot (args{:}); - set (hplt(kk--), "markersize", 2); + set (hplt(kk), "markersize", 2); + kk = kk - 1; if (! isempty (rlzer)) - set (hplt(kk--), "markersize", 2); + set (hplt(kk), "markersize", 2); + kk = kk - 1; endif for ii = 1:rows(rlpol) - set (hplt(kk--), "linewidth", 2); + set (hplt(kk), "linewidth", 2); + kk = kk - 1; endfor legend ("boxon", 2); grid ("on"); Index: ../octave-forge/extra/control-legacy/inst/dhinfdemo.m =================================================================== --- ../octave-forge/extra/control-legacy/inst/dhinfdemo.m (revision 7460) +++ ../octave-forge/extra/control-legacy/inst/dhinfdemo.m (working copy) @@ -112,7 +112,7 @@ disp(cmd); eval(cmd); ## omega axis (column vector) -ww = vec(logspace(-4.99, 3.99, 100)); +ww = reshape(logspace(-4.99, 3.99, 100),[],1); disp("Create ZOH equivalent model of a continuous plant"); cmd = "G = tf(2,[1 3 2]); Gd = c2d(G, Ts);"; Index: ../octave-forge/extra/control-legacy/inst/zgshsr.m =================================================================== --- ../octave-forge/extra/control-legacy/inst/zgshsr.m (revision 7460) +++ ../octave-forge/extra/control-legacy/inst/zgshsr.m (working copy) @@ -48,9 +48,9 @@ m = length (x); if (m > 1) beta = (1 + sqrt (m)) * x(1) + sum (x(2:m)); - beta /= (m + sqrt (m)); - x(1) -= (beta * (1 + sqrt (m))); - x(2:m) -= (beta * ones (m-1,1)); + beta = beta / (m + sqrt (m)); + x(1) = x(1) - (beta * (1 + sqrt (m))); + x(2:m) = x(2:m) - (beta * ones (m-1,1)); else x = -x; endif Index: ../octave-forge/extra/control-legacy/inst/zginit.m =================================================================== --- ../octave-forge/extra/control-legacy/inst/zginit.m (revision 7460) +++ ../octave-forge/extra/control-legacy/inst/zginit.m (working copy) @@ -92,6 +92,6 @@ endfor ## now set zz as log base 2 - zz *= (1 / log (2)); + zz = zz / log (2); endfunction Index: ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXTelectron_driftdiffusion.m =================================================================== --- ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXTelectron_driftdiffusion.m (revision 7460) +++ ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXTelectron_driftdiffusion.m (working copy) @@ -50,10 +50,10 @@ U = p0.*n0./denom; for ii = 1:BDForder - U += -nin(:,end-ii)*weight(ii+1); + U -= nin(:,end-ii)*weight(ii+1); endfor guess = nin(:,end); n = Udriftdiffusion(mesh,Dsides,guess,M,U,V,u); -endfunction \ No newline at end of file +endfunction Index: ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXThole_driftdiffusion.m =================================================================== --- ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXThole_driftdiffusion.m (revision 7460) +++ ../octave-forge/extra/secs2d/inst/DDGOXT/DDGOXThole_driftdiffusion.m (working copy) @@ -50,10 +50,10 @@ U = p0.*n0./denom; for ii=1:BDForder - U += -pin(:,end-ii)*weight(ii+1); + U -= pin(:,end-ii)*weight(ii+1); endfor guess = pin(:,end); p = Udriftdiffusion(mesh,Dsides,guess,M,U,-V,u); -endfunction \ No newline at end of file +endfunction Index: ../octave-forge/extra/jhandles/inst/__jhandles_get.m =================================================================== --- ../octave-forge/extra/jhandles/inst/__jhandles_get.m (revision 7460) +++ ../octave-forge/extra/jhandles/inst/__jhandles_get.m (working copy) @@ -27,7 +27,7 @@ names = char (handle.getNames ()); ret = struct([]); for k = 1:length (names) - ret.(tolower(names{k})) = java2mat (handle.get (names{k})); + setfield(ret,tolower(names{k}), java2mat (handle.get (names{k}))); endfor varargout{1} = ret; else Index: ../octave-forge/extra/jhandles/inst/allchild.m =================================================================== --- ../octave-forge/extra/jhandles/inst/allchild.m (revision 7460) +++ ../octave-forge/extra/jhandles/inst/allchild.m (working copy) @@ -26,7 +26,8 @@ hc = cell (1, length (h)); idx = 1; for hh = h - hc{idx++} = get (hh, "Children"); + hc{idx} = get (hh, "Children"); + idx=idx+1; endfor endif Index: ../octave-forge/extra/nurbs/inst/bspdegelev.m =================================================================== --- ../octave-forge/extra/nurbs/inst/bspdegelev.m (revision 7460) +++ ../octave-forge/extra/nurbs/inst/bspdegelev.m (working copy) @@ -102,9 +102,9 @@ end end % % // big loop thru knot vector -while b < m % while (b < m) { +while (b < m) % while (b < m) { i = b; % i = b; - while b < m && k(b+1) == k(b+2) % while (b < m && k[b] == k[b+1]) + while (b < m && k(b+1) == k(b+2)) % while (b < m && k[b] == k[b+1]) b = b + 1; % b++; end % mul = b - i + 1; % mul = b - i + 1; @@ -180,7 +180,7 @@ i = first; % i = first; j = last; % j = last; kj = j - kind + 1; % kj = j - kind + 1; - while j-i > tr % while (j - i > tr) { + while (j-i > tr) % while (j - i > tr) { % // loop and compute the new control points % // for one removal step if i < cind % if (i < cind) { Index: ../octave-forge/extra/nurbs/inst/bspkntins.m =================================================================== --- ../octave-forge/extra/nurbs/inst/bspkntins.m (revision 7460) +++ ../octave-forge/extra/nurbs/inst/bspkntins.m (working copy) @@ -71,7 +71,7 @@ s = b + d + r; % s = b + d + r; for j=r:-1:0 % for (j = r; j >= 0; j--) { - while u(j+1) <= k(i+1) && i > a % while (u[j] <= k[i] && i > a) { + while (u(j+1) <= k(i+1) && i > a) % while (u[j] <= k[i] && i > a) { for q=0:mc-1 % for (q = 0; q < mc; q++) ic(q+1,s-d) = c(q+1,i-d); % ictrl[s-d-1][q] = ctrl[i-d-1][q]; end Index: ../octave-forge/extra/symband/inst/ExampleGenEigenValues.m =================================================================== --- ../octave-forge/extra/symband/inst/ExampleGenEigenValues.m (revision 7460) +++ ../octave-forge/extra/symband/inst/ExampleGenEigenValues.m (working copy) @@ -10,13 +10,13 @@ nMax=400; % up to this size full matrices are computed too Aband=rand(n,b); -Aband(:,1)+=1; -Aband(:,1)+=1*(1:n)'; +Aband(:,1)=Aband(:,1)+1; +Aband(:,1)=Aband(:,1)+1*(1:n)'; for c=1:b Aband(n-c+1,c+1:b)=zeros(1,b-c); endfor Bband=0.1*rand(n,bb); -Bband(:,1)+=1.0; +Bband(:,1)=Bband(:,1)+1.0; for c=1:bb Bband(n-c+1,c+1:bb)=zeros(1,bb-c); endfor Index: ../octave-forge/extra/symband/inst/ExampleEigenValues.m =================================================================== --- ../octave-forge/extra/symband/inst/ExampleEigenValues.m (revision 7460) +++ ../octave-forge/extra/symband/inst/ExampleEigenValues.m (working copy) @@ -18,9 +18,9 @@ N=nx*ny; Ab=zeros(N,nx+1); -Ab(:,1)+=2.0*(1/(hx*hx)+1/(hy*hy)); -Ab(:,2)-=1/(hx*hx); -Ab(:,nx+1)-=1/(hy*hy); +Ab(:,1) = Ab(:,1) + 2.0*(1/(hx*hx)+1/(hy*hy)); +Ab(:,2) = Ab(:,2) - 1/(hx*hx); +Ab(:,nx+1) =Ab(:,nx+1) - 1/(hy*hy); for j=1:ny Ab(j*nx,2)=0.0; endfor @@ -28,7 +28,7 @@ Ab(i,nx+1)=0.0; endfor -Ab=Ab/pi**2; +Ab=Ab/pi^2; if(nx*ny<400) A=BandToFull(Ab); Index: ../octave-forge/extra/bim/inst/bim1a_advection_diffusion.m =================================================================== --- ../octave-forge/extra/bim/inst/bim1a_advection_diffusion.m (revision 7460) +++ ../octave-forge/extra/bim/inst/bim1a_advection_diffusion.m (working copy) @@ -102,12 +102,13 @@ error("bim1a_advection_diffusion: coefficient beta has wrong dimensions."); endif - gammaetak = bimu_logm ( (gamma.*eta)(1:end-1), (gamma.*eta)(2:end)); + tmp = gamma.*eta; + gammaetak = bimu_logm ( tmp(1:end-1), tmp(2:end)); veta = diff(eta); etak = bimu_logm ( eta(1:end-1), eta(2:end)); ck = alpha .* gammaetak .* etak ./ areak; - [bpk, bmk] = bimu_bernoulli( (vk - veta)./etak); + [bpk, bmk] = bimu_bernoulli( (vk - veta)./etak); dm1 = [-(ck.*bmk); NaN]; dp1 = [NaN; -(ck.*bpk)]; Property changes on: ../octave-forge/extra/NaN/inst/meansq.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/iqr.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/prctile.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/train_lda_sparse.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/classify.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/rankcorr.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Index: ../octave-forge/extra/NaN/inst/mahal.m =================================================================== --- ../octave-forge/extra/NaN/inst/mahal.m (revision 7460) +++ ../octave-forge/extra/NaN/inst/mahal.m (working copy) @@ -14,7 +14,7 @@ % % References: -% $Id: train_sc.m 2140 2009-07-02 12:03:55Z schloegl $ +% $Id$ % Copyright (C) 2009 by Alois Schloegl % This function is part of the NaN-toolbox % http://biosig-consulting.com/matlab/NaN/ Property changes on: ../octave-forge/extra/NaN/inst/mahal.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/harmmean.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/percentile.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/flag_nans_occured.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/flag_accuracy_level.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/sem.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/rms.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/nansum.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/test_sc.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/zscore.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/spearman.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/sumsq.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/geomean.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/gscatter.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/trimmean.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/coefficient_of_variation.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/center.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Index: ../octave-forge/extra/NaN/inst/norminv.m =================================================================== --- ../octave-forge/extra/NaN/inst/norminv.m (revision 7460) +++ ../octave-forge/extra/NaN/inst/norminv.m (working copy) @@ -52,4 +52,4 @@ x(k) = m; else x(k) = m(k); -end; +end; Property changes on: ../octave-forge/extra/NaN/inst/cdfplot.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/mad.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/skewness.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/load_fisheriris.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/xval.m ___________________________________________________________________ Added: svn:keywords + Id Revision Index: ../octave-forge/extra/NaN/inst/decovm.m =================================================================== --- ../octave-forge/extra/NaN/inst/decovm.m (revision 7460) +++ ../octave-forge/extra/NaN/inst/decovm.m (working copy) @@ -10,7 +10,7 @@ % % see also: MDBC, COVM, R2 -% $Id: decovm.m 2140 2009-07-02 12:03:55Z schloegl $ +% $Id$ % Copyright (c) 1999-2002,2009 by Alois Schloegl % This function is part of the NaN-toolbox % http://biosig-consulting.com/matlab/NaN/ Property changes on: ../octave-forge/extra/NaN/inst/decovm.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/meandev.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/cat2bin.m ___________________________________________________________________ Added: svn:keywords + Id Revision Property changes on: ../octave-forge/extra/NaN/inst/kurtosis.m ___________________________________________________________________ Modified: svn:keywords - Author Date Id Revision + Id Revision Index: ../octave-forge/extra/ocs/doc/buildsystemIFF.m =================================================================== --- ../octave-forge/extra/ocs/doc/buildsystemIFF.m (revision 7460) +++ ../octave-forge/extra/ocs/doc/buildsystemIFF.m (working copy) @@ -46,11 +46,11 @@ if (vars(irow)) for icol=1:columns(a) if (vars(icol)) - A(vars(irow),vars(icol)) += a(irow,icol); - Jac(vars(irow),vars(icol)) += b(irow,icol); + A(vars(irow),vars(icol)) = A(vars(irow),vars(icol)) + a(irow,icol); + Jac(vars(irow),vars(icol)) = Jac(vars(irow),vars(icol)) + b(irow,icol); end ## endif end ## endfor - res(vars(irow)) += c(irow); + res(vars(irow)) = res(vars(irow)) + c(irow); end ## endif end ## endfor Index: ../octave-forge/extra/ocs/doc/initsystemIFF.m =================================================================== --- ../octave-forge/extra/ocs/doc/initsystemIFF.m (revision 7460) +++ ../octave-forge/extra/ocs/doc/initsystemIFF.m (working copy) @@ -117,11 +117,11 @@ if (vars(irow)) for icol=1:columns(a) if (vars(icol)) - A(vars(irow),vars(icol)) += a(irow,icol); - B(vars(irow),vars(icol)) += b(irow,icol); + A(vars(irow),vars(icol)) = A(vars(irow),vars(icol)) + a(irow,icol); + B(vars(irow),vars(icol)) = B(vars(irow),vars(icol)) + b(irow,icol); end ## endif end ## endfor - C(vars(irow)) += c(irow); + C(vars(irow)) = C(vars(irow)) + c(irow); end ## endif end ## endfor end ## endfor @@ -175,12 +175,11 @@ if (vars(irow)) for icol=1:columns(a) if (vars(icol)) - A(vars(irow),vars(icol)) += a(irow,icol); - Jac(vars(irow),vars(icol)) += b(irow,icol); + A(vars(irow),vars(icol)) = A(vars(irow),vars(icol)) + a(irow,icol); + Jac(vars(irow),vars(icol)) = Jac(vars(irow),vars(icol)) + b(irow,icol); end ## endif end ## endfor - res(vars(irow)) +=... - c(irow); + res(vars(irow)) = res(vars(irow)) + c(irow); end ## endif end ## endfor end ## endfor Index: ../octave-forge/extra/ocs/inst/prs/prs_iff.m =================================================================== --- ../octave-forge/extra/ocs/inst/prs/prs_iff.m (revision 7460) +++ ../octave-forge/extra/ocs/inst/prs/prs_iff.m (working copy) @@ -207,7 +207,8 @@ [ns,cnt] = fscanf(fid,"%s","C"); if cnt - outstruct.namesn(++nnames)=nn; + nnames++; + outstruct.namesn(nnames)=nn; outstruct.namess{nnames}=ns; endif endwhile @@ -310,4 +311,4 @@ intvar += outstruct.LCR(LCRcount).nintvar(iel); endfor -endfunction \ No newline at end of file +endfunction Index: ../octave-forge/extra/ocs/inst/tst/tst_odepkg.m =================================================================== --- ../octave-forge/extra/ocs/inst/tst/tst_odepkg.m (revision 7460) +++ ../octave-forge/extra/ocs/inst/tst/tst_odepkg.m (working copy) @@ -95,7 +95,7 @@ odestruct = odeset(odestruct,"Jacobian", JAC); odestruct = odeset(odestruct,"Mass",MASS(0,x)); odestruct = odeset(odestruct,"RelTol", 1e-6,"AbsTol",1e6*eps, - "MaxStep", max(diff(t)),"InitialStep",(diff(t))(1)); + "MaxStep", max(diff(t)),"InitialStep",(diff(t(1:2)))); if verbosity(2) odestruct = odeset(odestruct, "OutputFcn", Index: ../octave-forge/extra/ad/inst/__ga__.m =================================================================== --- ../octave-forge/extra/ad/inst/__ga__.m (revision 7460) +++ ../octave-forge/extra/ad/inst/__ga__.m (working copy) @@ -349,7 +349,7 @@ for j = 1 : sb(2) for l = 1 : sa(2) for k = 1 : nd - cdx(k, i, j) += adx(k, i, l) * b(l, j) + a(i, l) * bdx(k, l, j); + cdx(k, i, j) = cdx(k, i, j) + adx(k, i, l) * b(l, j) + a(i, l) * bdx(k, l, j); endfor endfor endfor Index: ../octave-forge/extra/msh/inst/msh2m_topological_properties.m =================================================================== --- ../octave-forge/extra/msh/inst/msh2m_topological_properties.m (revision 7460) +++ ../octave-forge/extra/msh/inst/msh2m_topological_properties.m (working copy) @@ -164,11 +164,14 @@ triwside(2,triwside(1,:)==triwside(2,:)) = NaN; n(1,:) = triwside(1,ts(1,:)); - n(1,n(1,:)==1:nelem) = triwside(2,ts(1,:))(n(1,:)==1:nelem); + tmp = triwside(2,ts(1,:)); + n(1,n(1,:)==1:nelem) = tmp(n(1,:)==1:nelem); n(2,:) = triwside(1,ts(2,:)); - n(2,n(2,:)==1:nelem) = triwside(2,ts(2,:))(n(2,:)==1:nelem); + tmp = triwside(2,ts(2,:)); + n(2,n(2,:)==1:nelem) = tmp(n(2,:)==1:nelem); n(3,:) = triwside(1,ts(3,:)); - n(3,n(3,:)==1:nelem) = triwside(2,ts(3,:))(n(3,:)==1:nelem); + tmp = triwside(2,ts(3,:)); + n(3,n(3,:)==1:nelem) = tmp(n(3,:)==1:nelem); endfunction @@ -206,7 +209,7 @@ for ii = 1:nelem point = ( e(1,ii) == t ); - point += ( e(2,ii) == t ); + point = point + ( e(2,ii) == t ); [jj1] = find( sum(point(2:3,:)) == 2); [jj2] = find( sum(point([3 1],:)) == 2); @@ -218,17 +221,17 @@ for jj=1:length(jj1) output(2*numtrg+1,ii) = jj1(jj); output(2*numtrg+2,ii) = 1; - numtrg += 1; + numtrg = numtrg + 1; endfor for jj=1:length(jj2) output(2*numtrg+1,ii) = jj2(jj); output(2*numtrg+2,ii) = 2; - numtrg += 1; + numtrg = numtrg + 1; endfor for jj=1:length(jj3) output(2*numtrg+1,ii) = jj3(jj); output(2*numtrg+2,ii) = 3; - numtrg += 1; + numtrg = numtrg + 1; endfor endfor Index: ../octave-forge/extra/msh/inst/msh2m_equalize_mesh.m =================================================================== --- ../octave-forge/extra/msh/inst/msh2m_equalize_mesh.m (revision 7460) +++ ../octave-forge/extra/msh/inst/msh2m_equalize_mesh.m (working copy) @@ -50,7 +50,7 @@ x = msh.p(1,:)'; y = msh.p(2,:)'; - dnodes = unique(msh.e(1:2,:)(:)); + dnodes = unique(reshape(msh.e(1:2,:),[],1)); varnodes = setdiff([1:columns(msh.p)],dnodes); Ax = spalloc(length(x),length(x),1); @@ -73,10 +73,10 @@ ax(ii,jj,:) = ax(jj,ii,:) = -ones(1,1,nel); ay(ii,jj,:) = ay(jj,ii,:) = -ones(1,1,nel); - ax(ii,ii,:) -= ax(ii,jj,:); - ax(jj,jj,:) -= ax(ii,jj,:); - ay(ii,ii,:) -= ay(ii,jj,:); - ay(jj,jj,:) -= ay(ii,jj,:); + ax(ii,ii,:) = ax(ii,ii,:) - ax(ii,jj,:); + ax(jj,jj,:) = ax(jj,jj,:) - ax(ii,jj,:); + ay(ii,ii,:) = ay(ii,ii,:) - ay(ii,jj,:); + ay(jj,jj,:) = ay(jj,jj,:) - ay(ii,jj,:); endfor endfor Index: ../octave-forge/extra/msh/inst/msh2m_displacement_smoothing.m =================================================================== --- ../octave-forge/extra/msh/inst/msh2m_displacement_smoothing.m (revision 7460) +++ ../octave-forge/extra/msh/inst/msh2m_displacement_smoothing.m (working copy) @@ -103,10 +103,10 @@ ax(ii,jj,:) = ax(jj,ii,:) = reshape(-k * dx2(ii,:)./l2(ii,:),1,1,[]); ay(ii,jj,:) = ay(jj,ii,:) = reshape(-k * dy2(ii,:)./l2(ii,:),1,1,[]); - ax(ii,ii,:) -= ax(ii,jj,:); - ax(jj,jj,:) -= ax(ii,jj,:); - ay(ii,ii,:) -= ay(ii,jj,:); - ay(jj,jj,:) -= ay(ii,jj,:); + ax(ii,ii,:) = ax(ii,ii,:) - ax(ii,jj,:); + ax(jj,jj,:) = ax(jj,jj,:) - ax(ii,jj,:); + ay(ii,ii,:) = ay(ii,ii,:) - ay(ii,jj,:); + ay(jj,jj,:) = ay(jj,jj,:) - ay(ii,jj,:); endfor endfor Index: ../octave-forge/extra/msh/inst/msh2m_jiggle_mesh.m =================================================================== --- ../octave-forge/extra/msh/inst/msh2m_jiggle_mesh.m (revision 7460) +++ ../octave-forge/extra/msh/inst/msh2m_jiggle_mesh.m (working copy) @@ -57,27 +57,27 @@ x = msh.p(1,:)'; y = msh.p(2,:)'; - dnodes = unique(msh.e(1:2,:)(:)); + dnodes = unique(reshape(msh.e(1:2,:),[],1)); vnodes = setdiff(1:nnodes,dnodes); ## Find node neighbours ## FIXME: should this go into msh2m_topological_properties ? sides = msh2m_topological_properties(msh,"sides"); for inode = 1:nnodes - neig{inode} = (sides(:, sides(1,:) == inode | sides(2,:) == inode))(:); + neig{inode} = reshape(sides(:, sides(1,:) == inode | sides(2,:) == inode),[],1); neig{inode} (neig{inode} == inode) = []; endfor for istep = 1:steps for inode =vnodes xx = x(neig{inode}) * ones(size(neig{inode}))'; - lx = abs ( xx - xx' )(:); - mx = ( xx + xx' )(:)/2; + lx = reshape (abs ( xx - xx' ), [], 1); + mx = reshape ( xx + xx', [], 1 )/2; x(inode) = sum(mx.*lx)/sum(lx); yy = y(neig{inode}) * ones(size(neig{inode}))'; - ly = abs ( yy - yy' )(:); - my = (yy + yy')(:)/2; + ly = vec (abs ( yy - yy' )); + my = vec (yy + yy')/2; y(inode) = sum(my.*ly)/sum(ly); endfor endfor Index: ../octave-forge/extra/tsa/inst/lattice.m =================================================================== --- ../octave-forge/extra/tsa/inst/lattice.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/lattice.m (working copy) @@ -28,15 +28,17 @@ % see also ACOVF ACORF AR2RC RC2AR DURLEV SUMSKIPNAN % % REFERENCE(S): -% J.P. Burg, "Maximum Entropy Spectral Analysis" Proc. 37th Meeting of the Society of Exp. Geophysiscists, Oklahoma City, OK 1967 -% J.P. Burg, "Maximum Entropy Spectral Analysis" PhD-thesis, Dept. of Geophysics, Stanford University, Stanford, CA. 1975. -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% J.P. Burg, 'Maximum Entropy Spectral Analysis' Proc. 37th Meeting of the Society of Exp. Geophysiscists, Oklahoma City, OK 1967 +% J.P. Burg, 'Maximum Entropy Spectral Analysis' PhD-thesis, Dept. of Geophysics, Stanford University, Stanford, CA. 1975. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. -% $Id$ +% $Id$ % Copyright (C) 1996-2002,2008 by Alois Schloegl +% This is part of the TSA-toolbox. See also +% http://hci.tugraz.at/schloegl/matlab/tsa/ % % 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 Index: ../octave-forge/extra/tsa/inst/parcor.m =================================================================== --- ../octave-forge/extra/tsa/inst/parcor.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/parcor.m (working copy) @@ -22,10 +22,10 @@ % see also: PACF ACOVF ACORF DURLEV AC2RC % % REFERENCES: -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ Index: ../octave-forge/extra/tsa/inst/ucp.m =================================================================== --- ../octave-forge/extra/tsa/inst/ucp.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/ucp.m (working copy) @@ -8,8 +8,8 @@ % C(1)*X^N + ... + C(N)*X + C(N+1). % % REFERENCES: -% O. Foellinger "Lineare Abtastsysteme", Oldenburg Verlag, Muenchen, 1986. -% F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. +% O. Foellinger 'Lineare Abtastsysteme', Oldenburg Verlag, Muenchen, 1986. +% F. Gausch 'Systemtechnik', Textbook, University of Technology Graz, 1993. % $Id$ Index: ../octave-forge/extra/tsa/inst/invest0.m =================================================================== --- ../octave-forge/extra/tsa/inst/invest0.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/invest0.m (working copy) @@ -16,14 +16,16 @@ % NC Number of values (length-missing values) % % REFERENCES: -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% M.S. Grewal and A.P. Andrews 'Kalman Filtering' Prentice Hall, 1993. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. -% $Id$ +% $Id$ % Copyright (C) 1998-2003,2008 by Alois Schloegl +% This is part of the TSA-toolbox. See also +% http://hci.tugraz.at/schloegl/matlab/tsa/ % % 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 @@ -47,6 +49,7 @@ [nr,nc]=size(Y); NC = sumskipnan(real(~isnan(Y)),2); % number of valid components (data points) + if Mode==0 if nargin<2, Pmax = min([100 nc/3]); end; M = min(Pmax,nc-1); @@ -60,7 +63,11 @@ AutoCorr = AutoCov(:,2:M+1)./AutoCov(:,ones(M,1)); -if 1,Pmax<100; % this needs change of sinvest1 +if 0, Pmax<100; % this needs change of sinvest1 + [ARP,PartACF,E]=lattice(Y,Pmax); + MX = [ARP,PartACF]; + +elseif 1,Pmax<100; % this needs change of sinvest1 K=M-1; [MX,E]=lattice(Y,Pmax); %[MX,E]=ulsar(Y,Pmax); @@ -73,11 +80,3 @@ %MX=[ARP,RC]; end; - - - - - - - - Index: ../octave-forge/extra/tsa/inst/invest1.m =================================================================== --- ../octave-forge/extra/tsa/inst/invest1.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/invest1.m (working copy) @@ -24,11 +24,11 @@ % minE order where E is minimal % % REFERENCES: -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % optFPE order where FPE is minimal % optAIC order where AIC is minimal @@ -41,6 +41,9 @@ % $Id$ % Copyright (C) 1998-2002,2008 by Alois Schloegl +% This file is part of the Time Series Analysis (TSA) toolbox +% This is part of the TSA-toolbox. See also +% http://hci.tugraz.at/schloegl/matlab/tsa/ % % 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 Index: ../octave-forge/extra/tsa/inst/acorf.m =================================================================== --- ../octave-forge/extra/tsa/inst/acorf.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/acorf.m (working copy) @@ -24,10 +24,10 @@ % corresponds to one series % % REFERENCES: -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. -% J.S. Bendat and A.G.Persol "Random Data: Analysis and Measurement procedures", Wiley, 1986. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. +% J.S. Bendat and A.G.Persol 'Random Data: Analysis and Measurement procedures', Wiley, 1986. % calculating lpq, stderr, qpval from % suggested by Philip Gray, University of New South Wales, Index: ../octave-forge/extra/tsa/inst/mvfreqz.m =================================================================== --- ../octave-forge/extra/tsa/inst/mvfreqz.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/mvfreqz.m (working copy) @@ -234,8 +234,6 @@ end; end; -return; - if nargout<7, return; end; for k1=1:K1; Index: ../octave-forge/extra/tsa/inst/hup.m =================================================================== --- ../octave-forge/extra/tsa/inst/hup.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/hup.m (working copy) @@ -12,8 +12,8 @@ % each row a poly - Yet not tested % % REFERENCES: -% F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. -% Ch. Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970. +% F. Gausch 'Systemtechnik', Textbook, University of Technology Graz, 1993. +% Ch. Langraf and G. Schneider 'Elemente der Regeltechnik', Springer Verlag, 1970. % $Id$ % Copyright (c) 1995-1998,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/contents.m =================================================================== --- ../octave-forge/extra/tsa/inst/contents.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/contents.m (working copy) @@ -1,9 +1,9 @@ % Time Series Analysis - A toolbox for the use with Matlab and Octave. -% +% % $Id$ -% Copyright (C) 1996-2004,2008 by Alois Schloegl +% Copyright (C) 1996-2004,2008 by Alois Schloegl % WWW: http://hci.tugraz.at/~schloegl/matlab/tsa/ -% +% % 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 @@ -16,7 +16,7 @@ % % You should have received a copy of the GNU General Public License % along with this program. If not, see . -% +% % % Time Series Analysis - a toolbox for the use with Matlab % aar adaptive autoregressive estimator @@ -78,21 +78,21 @@ % REFERENCES (sources): % http://www.itl.nist.gov/ % http://mathworld.wolfram.com/ -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% O. Foellinger "Lineare Abtastsysteme", Oldenburg Verlag, Muenchen, 1986. -% F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. -% M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% E.I. Jury "Theory and Application of the z-Transform Method", Robert E. Krieger Publishing Co., 1973. -% M.S. Kay "Modern Spectal Estimation" Prentice Hall, 1988. -% Ch. Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970. -% S.L. Marple "Digital Spetral Analysis with Applications" Prentice Hall, 1987. -% C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% T. Schneider and A. Neumaier "Algorithm 808: ARFIT - a matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models" +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% O. Foellinger 'Lineare Abtastsysteme', Oldenburg Verlag, Muenchen, 1986. +% F. Gausch 'Systemtechnik', Textbook, University of Technology Graz, 1993. +% M.S. Grewal and A.P. Andrews 'Kalman Filtering' Prentice Hall, 1993. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% E.I. Jury 'Theory and Application of the z-Transform Method', Robert E. Krieger Publishing Co., 1973. +% M.S. Kay 'Modern Spectal Estimation' Prentice Hall, 1988. +% Ch. Langraf and G. Schneider 'Elemente der Regeltechnik', Springer Verlag, 1970. +% S.L. Marple 'Digital Spetral Analysis with Applications' Prentice Hall, 1987. +% C.L. Nikias and A.P. Petropulu 'Higher-Order Spectra Analysis' Prentice Hall, 1993. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% T. Schneider and A. Neumaier 'Algorithm 808: ARFIT - a matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models' % ACM Transactions on Mathematical software, 27(Mar), 58-65. -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % % % REFERENCES (applications): Index: ../octave-forge/extra/tsa/inst/acovf.m =================================================================== --- ../octave-forge/extra/tsa/inst/acovf.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/acovf.m (working copy) @@ -7,11 +7,11 @@ % Input: % Z Signal (one channel per row); % MAXLAG maximum lag -% Mode 'biased' : normalizes with N -% 'unbiased': normalizes with N-lag -% 'coeff' : normalizes such that lag 0 is 1 +% Mode 'biased' : normalizes with N [default] +% 'unbiased': normalizes with N-lag +% 'coeff' : normalizes such that lag 0 is 1 % others : no normalization -% +% % Output: % ACF autocovariance function % NN number of valid elements @@ -19,10 +19,10 @@ % % REFERENCES: % A.V. Oppenheim and R.W. Schafer, Digital Signal Processing, Prentice-Hall, 1975. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. -% J.S. Bendat and A.G.Persol "Random Data: Analysis and Measurement procedures", Wiley, 1986. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. +% J.S. Bendat and A.G.Persol 'Random Data: Analysis and Measurement procedures', Wiley, 1986. % $Id$ % Copyright (C) 1998-2003,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/aarmam.m =================================================================== --- ../octave-forge/extra/tsa/inst/aarmam.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/aarmam.m (working copy) @@ -58,10 +58,10 @@ % You should have received a copy of the GNU General Public License % along with this program. If not, see . -%#realonly -%#inbounds +%%realonly +%%inbounds -warning('AARMAM is obsolete. Use AMARMA instead!') +warning('AARMAM is obsolete. Use AMARMA instead~') [nc,nr]=size(y); Index: ../octave-forge/extra/tsa/inst/durlev.m =================================================================== --- ../octave-forge/extra/tsa/inst/durlev.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/durlev.m (working copy) @@ -21,12 +21,12 @@ % see also ACOVF ACORF AR2RC RC2AR LATTICE % % REFERENCES: -% Levinson N. (1947) "The Wiener RMS(root-mean-square) error criterion in filter design and prediction." J. Math. Phys., 25, pp.261-278. -% Durbin J. (1960) "The fitting of time series models." Rev. Int. Stat. Inst. vol 28., pp 233-244. -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% Levinson N. (1947) 'The Wiener RMS(root-mean-square) error criterion in filter design and prediction.' J. Math. Phys., 25, pp.261-278. +% Durbin J. (1960) 'The fitting of time series models.' Rev. Int. Stat. Inst. vol 28., pp 233-244. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (C) 1998-2002,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/mvar.m =================================================================== --- ../octave-forge/extra/tsa/inst/mvar.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/mvar.m (working copy) @@ -851,7 +851,7 @@ Z = (Y2+Y1)/2; Y(isnan(Y)) = Z(isnan(Y)); - [ARF,RCF,PE] = mvar(Y, Pmax, rem(Mode,100)); + [ARF,RCF,PE] = mvar(Y, Pmax, rem(Mode,100)); elseif Mode>=2300, % backward prediction @@ -859,8 +859,8 @@ % no decaying Y = flipud(Y); - [ARB,RCF,PE] = mvar(Y, Pmax, Mode0); - c = chol(PE(:,M*Pmax+(1:M))); + [ARB,RCF,PE] = mvar(Y, Pmax, Mode0); + c = chol(PE(:,M*Pmax+(1:M))); Y1 = Y; Y1(1,isnan(Y1(1,:))) = 0; z = []; Index: ../octave-forge/extra/tsa/inst/bispec.m =================================================================== --- ../octave-forge/extra/tsa/inst/bispec.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/bispec.m (working copy) @@ -8,8 +8,8 @@ % BISPEC Bi-spectrum % % Reference(s): -% C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993. -% M.B. Priestley, "Non-linear and Non-stationary Time series Analysis", Academic Press, London, 1988. +% C.L. Nikias and A.P. Petropulu 'Higher-Order Spectra Analysis' Prentice Hall, 1993. +% M.B. Priestley, 'Non-linear and Non-stationary Time series Analysis', Academic Press, London, 1988. % $Id$ % Copyright (C) 1997-2003,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/ar_spa.m =================================================================== --- ../octave-forge/extra/tsa/inst/ar_spa.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/ar_spa.m (working copy) @@ -1,3 +1,4 @@ + function [w,A,B,R,P,F,ip] = ar_spa(ARP,nhz,E); % AR_SPA decomposes an AR-spectrum into its compontents % [w,A,B,R,P,F,ip] = ar_spa(AR,fs,E); @@ -16,7 +17,7 @@ % P poles % ip number of complex conjugate poles % real(F) power, absolute values are obtained by multiplying with noise variance E(p+1) -% imag(F) assymetry, - " - +% imag(F) assymetry, - ' - % % All input and output parameters are organized in rows, one row % corresponds to the parameters of one channel @@ -102,3 +103,4 @@ np(:,2) = pp-np(:,1); % number of imaginary poles + Index: ../octave-forge/extra/tsa/inst/lpc.m =================================================================== --- ../octave-forge/extra/tsa/inst/lpc.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/lpc.m (working copy) @@ -23,12 +23,12 @@ % % REFERENCE(S): -% J.P. Burg, "Maximum Entropy Spectral Analysis" Proc. 37th Meeting of the Society of Exp. Geophysiscists, Oklahoma City, OK 1967 -% J.P. Burg, "Maximum Entropy Spectral Analysis" PhD-thesis, Dept. of Geophysics, Stanford University, Stanford, CA. 1975. -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% J.P. Burg, 'Maximum Entropy Spectral Analysis' Proc. 37th Meeting of the Society of Exp. Geophysiscists, Oklahoma City, OK 1967 +% J.P. Burg, 'Maximum Entropy Spectral Analysis' PhD-thesis, Dept. of Geophysics, Stanford University, Stanford, CA. 1975. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (C) 1996-2002,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/detrend.m =================================================================== --- ../octave-forge/extra/tsa/inst/detrend.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/detrend.m (working copy) @@ -153,5 +153,3 @@ end end; - - Index: ../octave-forge/extra/tsa/inst/arcext.m =================================================================== --- ../octave-forge/extra/tsa/inst/arcext.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/arcext.m (working copy) @@ -16,10 +16,10 @@ % see also ACOVF ACORF DURLEV % % REFERENCES: -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (C) 1998-2003,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/histo.m =================================================================== --- ../octave-forge/extra/tsa/inst/histo.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/histo.m (working copy) @@ -1,14 +1,14 @@ function [H,X]=histo(Y,Mode) -% HISTO calculates histogram for each column +% HISTO calculates histogram for each column % [H,X] = HISTO(Y,Mode) % -% Mode -% 'rows' : frequency of each row -% '1x' : single bin-values -% 'nx' : separate bin-values for each column +% Mode +% 'rows' : frequency of each row +% '1x' : single bin-values +% 'nx' : separate bin-values for each column % X are the bin-values % H is the frequency of occurence of value X -% +% % HISTO(Y) with no output arguments: % plots the histogram bar(X,H) % @@ -17,7 +17,7 @@ % see also: HISTO, HISTO2, HISTO3, HISTO4 % % REFERENCE(S): -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). % $Id$ % Copyright (C) 1996-2002,2008 by Alois Schloegl @@ -36,38 +36,38 @@ % % You should have received a copy of the GNU General Public License % along with this program. If not, see . - -if nargin<2, - Mode='1x'; -end; -Mode=lower(Mode); - -if strcmp(Mode,'rows') - R = histo4(Y); - -elseif strcmp(Mode,'column') - R = histo4(Y'); - R.X = R.X'; - -elseif strcmp(Mode,'1x') - R = histo3(Y); - -elseif strcmp(Mode,'nx') - R = histo2(Y); - -end; - + +if nargin<2, + Mode='1x'; +end; +Mode=lower(Mode); + +if strcmp(Mode,'rows') + R = histo4(Y); + +elseif strcmp(Mode,'column') + R = histo4(Y'); + R.X = R.X'; + +elseif strcmp(Mode,'1x') + R = histo3(Y); + +elseif strcmp(Mode,'nx') + R = histo2(Y); + +end; + H = R.H; X = R.X; if nargout == 0, - if any(size(X)==1), + if any(size(X)==1), if exist('OCTAVE_VERSION')<5, bar(R.X,R.H,'stacked'); else bar(R.X,R.H); end - else + else warning('2-dim X-values not supported\n') %bar3(R.X,R.H); - end; + end; end; Index: ../octave-forge/extra/tsa/inst/ar2poly.m =================================================================== --- ../octave-forge/extra/tsa/inst/ar2poly.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/ar2poly.m (working copy) @@ -13,10 +13,10 @@ % see also ACOVF ACORF DURLEV RC2AR FILTER FREQZ ZPLANE % % REFERENCES: -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (C) 1998-2002,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/selmo2.m =================================================================== --- ../octave-forge/extra/tsa/inst/selmo2.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/selmo2.m (working copy) @@ -1,3 +1,4 @@ + function X = selmo2(y,Pmax); % SELMO2 - model order selection for univariate and multivariate % autoregressive models @@ -75,3 +76,4 @@ X.OPT.PHI = optPHI; [tmp,X.OPT.MVAIC] = min(AIC_MV); + Index: ../octave-forge/extra/tsa/inst/aar.m =================================================================== --- ../octave-forge/extra/tsa/inst/aar.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/aar.m (working copy) @@ -23,8 +23,8 @@ % UC Update Coefficient, default 0 % a0 Initial AAR parameters [a(0,1), a(0,2), ..., a(0,p),b(0,1),b(0,2), ..., b(0,q)] % (row vector with p+q elements, default zeros(1,p) ) -% A Initial Covariance matrix (positive definite pxp-matrix, default eye(p)) -% W system noise (required for aMode==0) +% A Initial Covariance matrix (positive definite pxp-matrix, default eye(p)) +% W system noise (required for aMode==0) % V observation noise (required for vMode==0) % % Output: @@ -99,36 +99,36 @@ end; end; end; - -if nargin<7, W = []; else W = arg7; end; + +if nargin<7, W = []; else W = arg7; end; -if all(size(W)==MOP), - if aMode ~= 0, - fprintf(1,'aMode should be 0, because W is given.\n'); - end; -elseif isempty(W), - if aMode == 0, - fprintf(1,'aMode must be non-zero, because W is not given.\n'); - end; -elseif any(size(W)~=MOP), - fprintf(1,'size of W does not fit. It must be %i x %i.\n',MOP,MOP); - return; -end; - -if nargin<8, V0 = []; else V0 = arg8; end; -if all(size(V0)==nr), - if vMode ~= 0, - fprintf(1,'vMode should be 0, because V is given.\n'); - end; -elseif isempty(V0), - if aMode == 0, - fprintf(1,'vMode must be non-zero, because V is not given.\n'); - end; -else - fprintf(1,'size of V does not fit. It must be 1x1.\n'); - return; -end; - +if all(size(W)==MOP), + if aMode ~= 0, + fprintf(1,'aMode should be 0, because W is given.\n'); + end; +elseif isempty(W), + if aMode == 0, + fprintf(1,'aMode must be non-zero, because W is not given.\n'); + end; +elseif any(size(W)~=MOP), + fprintf(1,'size of W does not fit. It must be %i x %i.\n',MOP,MOP); + return; +end; + +if nargin<8, V0 = []; else V0 = arg8; end; +if all(size(V0)==nr), + if vMode ~= 0, + fprintf(1,'vMode should be 0, because V is given.\n'); + end; +elseif isempty(V0), + if aMode == 0, + fprintf(1,'vMode must be non-zero, because V is not given.\n'); + end; +else + fprintf(1,'size of V does not fit. It must be 1x1.\n'); + return; +end; + % if nargin<7 TH=3; else TH = arg7; end; % TH=TH*var(y); % TH=TH*mean(detrend(y,0).^2); @@ -162,11 +162,11 @@ A=A0; E=y(1); e(1)=E; -if ~isempty(V0) - V(1) = V0; -else +if ~isempty(V0) + V(1) = V0; +else V(1) = (1-UC) + UC*E*E; -end; +end; ESU(1) = 1; %Y'*A*Y; A1=zeros(MOP);A2=A1; Index: ../octave-forge/extra/tsa/inst/histo2.m =================================================================== --- ../octave-forge/extra/tsa/inst/histo2.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/histo2.m (working copy) @@ -13,10 +13,10 @@ % see also: HISTO, HISTO2, HISTO3, HISTO4 % % REFERENCE(S): -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). % $Id$ -% Copyright (C) 1996-2002,2008 by Alois Schloegl +% Copyright (C) 1996-2002,2008,2009 by Alois Schloegl % This is part of the TSA-toolbox % http://hci.tugraz.at/~schloegl/matlab/tsa/ % @@ -33,16 +33,40 @@ % You should have received a copy of the GNU General Public License % along with this program. If not, see . +if 0; exist('histo_mex','file') + % TODO: Performance tests showing an advantage +try + R = histo_mex(Y); +catch + for k=1:size(Y,2); + r = histo_mex(Y(:,k)); + %r.H = r.H(~isnan(r.X)); + %r.X = r.X(~isnan(r.X)); + d = size(R.X,1) - size(r.X,1); + if (k==1) + R = r; + elseif (d>0) + R.X(1:length(r.H),k)= [r.X;repmat(NaN,d,1)]; + R.H(1:length(r.H),k)= [r.H;repmat(0,d,1)]; + else + R.X = [[R.X;repmat(NaN,-d,size(R.X,2))],r.X]; + R.H = [[R.H;repmat(0,-d,size(R.X,2))],r.H]; + end; + end; +end; + return; +end; + [yr,yc] = size(Y); -if yr==1, - % Makes sure there is a second row - % Sort does not support the DIM-argument, therefore, - % this function would not work correctly with this software - % Once this is fixed, this part can be removed. - Y = [Y; NaN+ones(size(Y))]; -end; +if yr==1, + % Makes sure there is a second row + % Sort does not support the DIM-argument, therefore, + % this function would not work correctly with this software + % Once this is fixed, this part can be removed. + Y = [Y; NaN+ones(size(Y))]; +end; sY = sort(Y); N = sum(~isnan(Y),1); @@ -72,5 +96,3 @@ R.X = X; R.N = sumskipnan(R.H,1); - - \ No newline at end of file Index: ../octave-forge/extra/tsa/inst/histo3.m =================================================================== --- ../octave-forge/extra/tsa/inst/histo3.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/histo3.m (working copy) @@ -1,33 +1,33 @@ function [R,tix]=histo3(Y) -% HISTO3 calculates histogram and performs data compression +% HISTO3 calculates histogram and performs data compression % % R = HISTO3(Y) % R is a struct with th fields % R.X are the bin-values % R.H is the frequency of occurence of value X -% R.N are the number of valid (not NaN) samples -% -% Data compression can be performed in this way -% [R,tix] = histo3(Y) -% is the compression step -% -% R.tix provides a compressed data representation. -% R.compressionratio estimates the compression ratio -% -% R.X(tix) and R.X(R.tix) -% reconstruct the orginal signal (decompression) -% -% The effort (in memory and speed) for compression is O(n*log(n)). -% The effort (in memory and speed) for decompression is O(n) only. +% R.N are the number of valid (not NaN) samples % +% Data compression can be performed in this way +% [R,tix] = histo3(Y) +% is the compression step +% +% R.tix provides a compressed data representation. +% R.compressionratio estimates the compression ratio +% +% R.X(tix) and R.X(R.tix) +% reconstruct the orginal signal (decompression) +% +% The effort (in memory and speed) for compression is O(n*log(n)). +% The effort (in memory and speed) for decompression is O(n) only. +% % see also: HISTO, HISTO2, HISTO3, HISTO4 % % REFERENCE(S): -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). % $Id$ -% Copyright (C) 1996-2002,2008 by Alois Schloegl +% Copyright (C) 1996-2002,2008,2009 by Alois Schloegl % This is part of the TSA-toolbox. See also % http://hci.tugraz.at/schloegl/matlab/tsa/ % http://octave.sourceforge.net/ @@ -45,21 +45,34 @@ % % You should have received a copy of the GNU General Public License % along with this program. If not, see . - + +if 0;exist('histo_mex','file') + % TODO: Performance tests showing an advantage +try + if (nargout<2) + R = histo_mex(Y); + else + [R,tix] = histo_mex(Y); + R.tix = tix; + end; + return; +end; +end; + [yr,yc]=size(Y); -if yr==1, - % Makes sure there is a second row - % Sort does not support the DIM-argument, therefore, - % this function would not work correctly with this software - % Once this is fixed, this part can be removed. - Y = [Y; NaN+ones(size(Y))]; -end; +if yr==1, + % Makes sure there is a second row + % Sort does not support the DIM-argument, therefore, + % this function would not work correctly with this software + % Once this is fixed, this part can be removed. + Y = [Y; NaN+ones(size(Y))]; +end; % identify all possible X's and overall Histogram [sY ,idx] = sort(Y(:)); -[tmp,idx] = sort(idx); % generate inverse index - +[tmp,idx] = sort(idx); % generate inverse index + ix = diff(sY,1)>0; tmp = [find(ix); sum(~isnan(sY))]; H = diff([0; tmp]); @@ -67,31 +80,31 @@ R.datatype = 'HISTOGRAM'; R.X = sY(tmp); R.N = sum(~isnan(Y),1); - -% generate inverse index -if nargout>1, - tix = cumsum([1;ix]); % rank - tix = reshape(tix(idx),yr,yc); % inverse sort rank - cc = 1; - tmp = sum(ix)+1; + +% generate inverse index +if nargout>1, + tix = cumsum([1;ix]); % rank + tix = reshape(tix(idx),yr,yc); % inverse sort rank + cc = 1; + tmp = sum(ix)+1; if exist('OCTAVE_VERSION')>=5, ; % NOP; no support for integer datatyp - elseif tmp <= 2^8; - tix = uint8(tix); - cc = 8/1; - elseif tmp <= 2^16; - tix = uint16(tix); - cc = 8/2; - elseif tmp <= 2^32; - tix = uint32(tix); - cc = 8/4; - end; - R.compressionratio = (prod(size(R.X)) + (yr*yc)/cc) / (yr*yc); - R.tix = tix; -end; - - + elseif tmp <= 2^8; + tix = uint8(tix); + cc = 8/1; + elseif tmp <= 2^16; + tix = uint16(tix); + cc = 8/2; + elseif tmp <= 2^32; + tix = uint32(tix); + cc = 8/4; + end; + R.compressionratio = (prod(size(R.X)) + (yr*yc)/cc) / (yr*yc); + R.tix = tix; +end; + + % if yc==1, we are all set; else if yc>1, % a few more steps are necessary H0 = H; %overall histogram @@ -123,8 +136,7 @@ fprintf(2,'ERROR HISTO\n'); end; end; - -R.H = H; +R.H = H; - \ No newline at end of file + Index: ../octave-forge/extra/tsa/inst/ar2rc.m =================================================================== --- ../octave-forge/extra/tsa/inst/ar2rc.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/ar2rc.m (working copy) @@ -21,10 +21,10 @@ % see also ACOVF ACORF DURLEV RC2AR % % REFERENCES: -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (C) 1998-2002,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/rc2ar.m =================================================================== --- ../octave-forge/extra/tsa/inst/rc2ar.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/rc2ar.m (working copy) @@ -21,10 +21,10 @@ % see also ACOVF ACORF DURLEV AR2RC % % REFERENCES: -% P.J. Brockwell and R. A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3rd ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% P.J. Brockwell and R. A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3rd ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % $Id$ % Copyright (c) 1996-2002,2007,2008 by Alois Schloegl Index: ../octave-forge/extra/tsa/inst/content.m =================================================================== --- ../octave-forge/extra/tsa/inst/content.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/content.m (working copy) @@ -3,7 +3,7 @@ % WWW: http://hci.tugraz.at/~schloegl/matlab/tsa/ % % $Id$ -% Copyright (C) 1996-2003,2008 by Alois Schloegl +% Copyright (C) 1996-2003,2008 by Alois Schloegl % % Time Series Analysis - a toolbox for the use with Matlab % aar adaptive autoregressive estimator @@ -60,21 +60,21 @@ % REFERENCES (sources): % http://www.itl.nist.gov/ % http://mathworld.wolfram.com/ -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% O. Foellinger "Lineare Abtastsysteme", Oldenburg Verlag, Muenchen, 1986. -% F. Gausch "Systemtechnik", Textbook, University of Technology Graz, 1993. -% M.S. Grewal and A.P. Andrews "Kalman Filtering" Prentice Hall, 1993. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% E.I. Jury "Theory and Application of the z-Transform Method", Robert E. Krieger Publishing Co., 1973. -% M.S. Kay "Modern Spectal Estimation" Prentice Hall, 1988. -% Ch. Langraf and G. Schneider "Elemente der Regeltechnik", Springer Verlag, 1970. -% S.L. Marple "Digital Spetral Analysis with Applications" Prentice Hall, 1987. -% C.L. Nikias and A.P. Petropulu "Higher-Order Spectra Analysis" Prentice Hall, 1993. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% T. Schneider and A. Neumaier "Algorithm 808: ARFIT - a matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models" +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% O. Foellinger 'Lineare Abtastsysteme', Oldenburg Verlag, Muenchen, 1986. +% F. Gausch 'Systemtechnik', Textbook, University of Technology Graz, 1993. +% M.S. Grewal and A.P. Andrews 'Kalman Filtering' Prentice Hall, 1993. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% E.I. Jury 'Theory and Application of the z-Transform Method', Robert E. Krieger Publishing Co., 1973. +% M.S. Kay 'Modern Spectal Estimation' Prentice Hall, 1988. +% Ch. Langraf and G. Schneider 'Elemente der Regeltechnik', Springer Verlag, 1970. +% S.L. Marple 'Digital Spetral Analysis with Applications' Prentice Hall, 1987. +% C.L. Nikias and A.P. Petropulu 'Higher-Order Spectra Analysis' Prentice Hall, 1993. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% T. Schneider and A. Neumaier 'Algorithm 808: ARFIT - a matlab package for the estimation of parameters and eigenmodes of multivariate autoregressive models' % ACM Transactions on Mathematical software, 27(Mar), 58-65. -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. % % % REFERENCES (applications): Index: ../octave-forge/extra/tsa/inst/adim.m =================================================================== --- ../octave-forge/extra/tsa/inst/adim.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/adim.m (working copy) @@ -1,24 +1,24 @@ function [IR, CC, D] = adim(U, UC, IR, CC, arg5); -% ADIM adaptive information matrix. Estimates the inverse -% correlation matrix in an adaptive way. -% -% [IR, CC] = adim(U, UC [, IR0 [, CC0]]); -% U input data -% UC update coefficient 0 < UC << 1 -% IR0 initial information matrix +% ADIM adaptive information matrix. Estimates the inverse +% correlation matrix in an adaptive way. +% +% [IR, CC] = adim(U, UC [, IR0 [, CC0]]); +% U input data +% UC update coefficient 0 < UC << 1 +% IR0 initial information matrix % CC0 initial correlation matrix -% IR information matrix (inverse correlation matrix) +% IR information matrix (inverse correlation matrix) % CC correlation matrix -% -% The algorithm uses the Matrix Inversion Lemma, also known as -% "Woodbury's identity", to obtain a recursive algorithm. -% IR*CC - UC*I should be approx. zero. -% -% Reference(s): -% [1] S. Haykin. Adaptive Filter Theory, Prentice Hall, Upper Saddle River, NJ, USA -% pp. 565-567, Equ. (13.16), 1996. - - +% +% The algorithm uses the Matrix Inversion Lemma, also known as +% 'Woodbury''s identity', to obtain a recursive algorithm. +% IR*CC - UC*I should be approx. zero. +% +% Reference(s): +% [1] S. Haykin. Adaptive Filter Theory, Prentice Hall, Upper Saddle River, NJ, USA +% pp. 565-567, Equ. (13.16), 1996. + + % $Id$ % Copyright (C) 1998-2003 by Alois Schloegl % @@ -36,96 +36,96 @@ % along with this program. If not, see . - -[ur,p] = size(U); - -Mode_E = 1; -%if nargin < 4, -% m = zeros(size(U)+[0,Mode_E]); -%end; - -if nargin<2, - fprintf(2,'Error ADIM: missing update coefficient\n'); - return; -else - if ~((UC > 0) & (UC <1)), - fprintf(2,'Error ADIM: update coefficient not within range [0,1]\n'); - return; - end; - if UC > 1/p, - fprintf(2,'Warning ADIM: update coefficient should be smaller than 1/number_of_dimensions\n'); - end; -end; - -if nargin<3, - IR = []; -end; -if nargin<4, - CC = []; -end; -if nargin<5, - arg5 = 6; -end; -if isempty(IR), - IR = eye(p+Mode_E); -end; -if isempty(CC), - CC = eye(p+Mode_E); -end; - -D = zeros(ur,(p+Mode_E)^2); -%D = zeros(ur,1); -W = eye(p+Mode_E)*UC/(p+Mode_E); -W2 = eye(p+Mode_E)*UC*UC/(p+Mode_E); - -for k = 1:ur, - if ~Mode_E, - % w/o mean term - d = U(k,:); - else - % w/ mean term - d = [1,U(k,:)]; - end; - - if ~any(isnan(d)), - CC = (1-UC)*CC + UC*(d'*d); - - %K = (1+UC)*IR*d'/(1+(1+UC)*d*IR*d'); - v = IR*d'; - %K = v/(1-UC+d*v); - - if arg5==0; % original version according to [1], can become unstable - IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v'; - - elseif arg5==1; % this provides IR*CC == I, this seems to be stable - IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W; - - elseif arg5==6; % DEFAULT: - IR = ((1+UC)/2)*(IR+IR') - ((1+UC)/(1-UC+d*v))*v*v'; - - % more variants just for testing, do not use them. - elseif arg5==2; - IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W2; - - elseif arg5==3; - IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); - - elseif arg5==4; - IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); - - elseif arg5==5; - IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); - - end; - end; - - %D(k) = det(IR); - D(k,:) = IR(:)'; -end; - -IR = IR / UC; -if Mode_E, - IR(1,1) = IR(1,1) - 1; -end; - - + +[ur,p] = size(U); + +Mode_E = 1; +%if nargin < 4, +% m = zeros(size(U)+[0,Mode_E]); +%end; + +if nargin<2, + fprintf(2,'Error ADIM: missing update coefficient\n'); + return; +else + if ~((UC > 0) & (UC <1)), + fprintf(2,'Error ADIM: update coefficient not within range [0,1]\n'); + return; + end; + if UC > 1/p, + fprintf(2,'Warning ADIM: update coefficient should be smaller than 1/number_of_dimensions\n'); + end; +end; + +if nargin<3, + IR = []; +end; +if nargin<4, + CC = []; +end; +if nargin<5, + arg5 = 6; +end; +if isempty(IR), + IR = eye(p+Mode_E); +end; +if isempty(CC), + CC = eye(p+Mode_E); +end; + +D = zeros(ur,(p+Mode_E)^2); +%D = zeros(ur,1); +W = eye(p+Mode_E)*UC/(p+Mode_E); +W2 = eye(p+Mode_E)*UC*UC/(p+Mode_E); + +for k = 1:ur, + if ~Mode_E, + % w/o mean term + d = U(k,:); + else + % w/ mean term + d = [1,U(k,:)]; + end; + + if ~any(isnan(d)), + CC = (1-UC)*CC + UC*(d'*d); + + %K = (1+UC)*IR*d'/(1+(1+UC)*d*IR*d'); + v = IR*d'; + %K = v/(1-UC+d*v); + + if arg5==0; % original version according to [1], can become unstable + IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v'; + + elseif arg5==1; % this provides IR*CC == I, this seems to be stable + IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W; + + elseif arg5==6; % DEFAULT: + IR = ((1+UC)/2)*(IR+IR') - ((1+UC)/(1-UC+d*v))*v*v'; + + % more variants just for testing, do not use them. + elseif arg5==2; + IR = IR - (1+UC)/(1-UC+d*v)*v*v' + sum(diag(IR))*W2; + + elseif arg5==3; + IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); + + elseif arg5==4; + IR = (1+UC)*IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); + + elseif arg5==5; + IR = IR - (1+UC)/(1-UC+d*v)*v*v' + eps*eye(p+Mode_E); + + end; + end; + + %D(k) = det(IR); + D(k,:) = IR(:)'; +end; + +IR = IR / UC; +if Mode_E, + IR(1,1) = IR(1,1) - 1; +end; + + Index: ../octave-forge/extra/tsa/inst/selmo.m =================================================================== --- ../octave-forge/extra/tsa/inst/selmo.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/selmo.m (working copy) @@ -28,14 +28,14 @@ % AIC > FPE > *MDL* > PHI > SBC > CAT ~ BIC % % REFERENCES: -% P.J. Brockwell and R.A. Davis "Time Series: Theory and Methods", 2nd ed. Springer, 1991. -% S. Haykin "Adaptive Filter Theory" 3ed. Prentice Hall, 1996. -% M.B. Priestley "Spectral Analysis and Time Series" Academic Press, 1981. -% C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963). -% W.S. Wei "Time Series Analysis" Addison Wesley, 1990. -% Jenkins G.M. Watts D.G "Spectral Analysis and its applications", Holden-Day, 1968. -% G. Haring "Über die Wahl der optimalen Modellordnung bei der Darstellung von stationären Zeitreihen mittels Autoregressivmodell als Basis der Analyse von EEG - Biosignalen mit Hilfe eines Digitalrechners", Habilitationschrift - Technische Universität Graz, Austria, 1975. -% (1)"About selecting the optimal model at the representation of stationary time series by means of an autoregressive model as basis of the analysis of EEG - biosignals by means of a digital computer)" +% P.J. Brockwell and R.A. Davis 'Time Series: Theory and Methods', 2nd ed. Springer, 1991. +% S. Haykin 'Adaptive Filter Theory' 3ed. Prentice Hall, 1996. +% M.B. Priestley 'Spectral Analysis and Time Series' Academic Press, 1981. +% C.E. Shannon and W. Weaver 'The mathematical theory of communication' University of Illinois Press, Urbana 1949 (reprint 1963). +% W.S. Wei 'Time Series Analysis' Addison Wesley, 1990. +% Jenkins G.M. Watts D.G 'Spectral Analysis and its applications', Holden-Day, 1968. +% G. Haring 'Über die Wahl der optimalen Modellordnung bei der Darstellung von stationären Zeitreihen mittels Autoregressivmodell als Basis der Analyse von EEG - Biosignalen mit Hilfe eines Digitalrechners', Habilitationschrift - Technische Universität Graz, Austria, 1975. +% (1)'About selecting the optimal model at the representation of stationary time series by means of an autoregressive model as basis of the analysis of EEG - biosignals by means of a digital computer)' % % $Id$ @@ -74,8 +74,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 +138,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(:)']'; Index: ../octave-forge/extra/tsa/inst/flag_implicit_samplerate.m =================================================================== --- ../octave-forge/extra/tsa/inst/flag_implicit_samplerate.m (revision 7460) +++ ../octave-forge/extra/tsa/inst/flag_implicit_samplerate.m (working copy) @@ -15,7 +15,7 @@ % flag_implicit_samplerate(2) % calculation along rows % -% DIM = flag_implicit_samplerate() +% DIM = flag_implicit_samplerate % gets default mode % % flag_implicit_samplerate(DIM) Index: ../octave-forge/extra/gnuplot/inst/g_ez.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_ez.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_ez.m (working copy) @@ -79,35 +79,35 @@ # || strcmp (cmd(end-3:end), ".pgm")\ # || strcmp (cmd(end-3:end), ".jpg")) filename = cmd; - cnt++; + cnt=cnt+1; continue endif switch cmd case {"title", "xlabel", "ylabel", "x2label", "y2label"}, - str = varargin{++cnt}; + cnt=cnt+1; str = varargin{cnt}; if !ischar (str), error ("Option '%s' requires a char argument; got a %s",\ cmd, typeinfo (str)); endif #str = strrep (str,"%","\\%") - args.(cmd) = str; + setfield(args,cmd,str); case "color" - do_color = varargin{++cnt}; + cnt=cnt+1; do_color = varargin{cnt}; case {"display", "-display"} - do_display = varargin{++cnt}; + cnt=cnt+1; do_display = varargin{cnt}; case "label" - str = varargin{++cnt}; + cnt=cnt+1; str = varargin{cnt}; if !ischar (str), error ("Option '%s' requires a char argument; got a %s",\ cmd, typeinfo (str)); endif - pos = varargin{++cnt}; + cnt=cnt+1; pos = varargin{cnt}; if !isnumeric (pos), error ("Option '%s' requires a 1 x 2 matrix argument; got a %s",\ cmd, typeinfo (pos)); @@ -120,10 +120,12 @@ labpos = [labpos;pos]; #str = strrep (str,"%","\\%") case {"geometry", "xrange", "yrange", "x2range", "y2range"}, - args.(cmd) = varargin{++cnt}; + cnt=cnt+1; + setfield(args,cmd,varargin{cnt}); case {"range"}, - args.xrange = args.yrange = varargin{++cnt}; + cnt=cnt+1; + args.xrange = args.yrange = varargin{cnt}; case "grid" args.grid = ""; @@ -133,17 +135,19 @@ args.grid = "y"; case "xmap" - args.xmap = varargin{++cnt}; + cnt = cnt + 1; + args.xmap = varargin{cnt}; case "ymap" - args.ymap = varargin{++cnt}; + cnt = cnt + 1; + args.ymap = varargin{cnt}; case "plot" - do # Add following datasets - nplots++; + while (1), # do # Add following datasets + nplots=nplots+1; foundLabels = {}; # Labels for datapoints - data = varargin{++cnt}; + cnt=cnt+1; data = varargin{cnt}; if !isnumeric (data) error ("Argument after 'plot' should be numeric. Got '%s'.",\ typeinfo(data)); @@ -158,7 +162,7 @@ if cnt < length (varargin) if isnumeric (varargin{cnt+1}) # x and y are separate args - tmp = varargin{++cnt}; + cnt=cnt+1; tmp = varargin{cnt}; if prod (size (tmp)) != prod (size (data)) if rows (data) != rows (tmp) if rows (data) == columns (tmp) @@ -209,7 +213,7 @@ ##foundLabels if iscell (try_arg) # user-specified labels foundLabels = try_arg; - cnt++; + cnt=cnt+1; try_arg = 0; if cnt < N try_arg = varargin{cnt+1}; @@ -222,7 +226,7 @@ [imFmt, extra, nImArgs,zrange] = _g_image_cmd (size (data), zrange, args, {varargin{cnt+2:end}}); - cnt += nImArgs + 1; + cnt = cnt + nImArgs + 1; data = floor (255.999*(data - zrange(1))/diff(zrange)); data(data < 0) = 0; @@ -271,7 +275,7 @@ stops = [stops, [7 9 11]+11*(i-1)]; end - cnt += 1; + cnt = cnt + 1; plotcmds = [plotcmds, "'", names{nplots},"' ","w l title '' , "]; stop{nplots} = stops; @@ -280,7 +284,7 @@ [isFmt, fmtContents, wantLabel] = _g_parse_oct_fmt (try_arg, nplots,foundLabels); - cnt += isFmt; + cnt = cnt + isFmt; if wantLabel dataLabels{nplots} = 1; else @@ -298,23 +302,27 @@ # Determine how to plot it # EOF read datasets - until (cnt >= N) || !isnumeric (varargin{cnt+1}); + if ((cnt >= N) || !isnumeric (varargin{cnt+1})), break; endif; + endwhile; # EOF case plot - case "cmd" - args.cmds = {args.cmds{:}, varargin{++cnt}}; + case "cmd" + cnt = cnt + 1; + args.cmds = {args.cmds{:}, varargin{cnt}}; case "wait" - do_wait = varargin{++cnt}; + cnt = cnt + 1; + do_wait = varargin{cnt}; case {"xtics","ytics", "x2tics", "y2tics", "tics"}, - t = varargin{++cnt}; - args.(cmd) = t; + cnt = cnt + 1; + t = varargin{cnt}; + setfield(args,cmd,t); otherwise error ("Unknown command '%s'", cmd); endswitch - cnt++; + cnt = cnt + 1; endwhile # EOF Read arguments and put in struct # Transform args in a gnuplot_object @@ -335,7 +343,7 @@ "grid", "xgrid", "ygrid"}; for i = 1:length(tmp) if isfield (args, tmp{i}) - value = args.(tmp{i}); + value = getfield(args,tmp{i}); val_str = _g_stringify (tmp{i}, value); g = g_cmd (g,["set ",tmp{i}," ",val_str,""]); endif @@ -353,10 +361,10 @@ Ztics = [Z,"tics"]; Zrange = [Z,"range"]; - if ! isempty (args.(Zmap)) && ! isfield (args,Ztics) # Must figure tics for map + if ! isempty (getfield(args,Zmap)) && ! isfield (args,Ztics) # Must figure tics for map if isfield(args,Zrange) # Determine range - rng = args.(Zrange); + rng = getfield(args,Zrange); else rng = [inf,-inf]; for i = 1:nplots @@ -367,33 +375,33 @@ end assert (all (isfinite (rng))) end - args.(Ztics) = _g_default_tics (rng); + getfield(args,Ztics) = _g_default_tics (rng); end if isfield(args,Ztics) - if isempty (args.(Ztics)) # No tics + if isempty (getfield(args,Ztics)) # No tics g = g_cmd (g,["unset ",Ztics]); # Explicit command tics - elseif ischar (args.(Ztics)) + elseif ischar (getfield(args,Ztics)) - g = g_cmd (g, ["set ", Ztics, " ", args.(Ztics)]); + g = g_cmd (g, ["set ", Ztics, " ", getfield(args,Ztics)]); # Numerical tics else Zmajor = {}; - if any (isnan (args.(Ztics))) # FIXME only works for vector args.(Ztics) - imajor = find(isnan (args.(Ztics))); - imajor -= cumsum(isnan (args.(Ztics)))(imajor) - 1; + if any (isnan (getfield(args,Ztics))) # FIXME only works for vector getfield(args,Ztics) + imajor = find(isnan (getfield(args,Ztics))); + imajor = imajor - cumsum(isnan (getfield(args,Ztics)))(imajor) - 1; Zmajor = {"major",imajor}; - args.(Ztics) = args.(Ztics)(! isnan (args.(Ztics))); + getfield(args,Ztics) = getfield(args,Ztics)(! isnan (getfield(args,Ztics))); end - if ! isempty (args.(Zmap)) && isvector (args.(Ztics)) - args.(Ztics) = [_g_map(args.(Zmap), args.(Ztics)(:)'); args.(Ztics)(:)']; - g = g_cmd (g, _g_tics (args.(Ztics)(1,:), args.(Ztics)(2,:), Z, Zmajor{:})); + if ! isempty (getfield(args,Zmap)) && isvector (getfield(args,Ztics)) + getfield(args,Ztics) = [_g_map(getfield(args,Zmap), getfield(args,Ztics)(:)'); getfield(args,Ztics)(:)']; + g = g_cmd (g, _g_tics (getfield(args,Ztics)(1,:), getfield(args,Ztics)(2,:), Z, Zmajor{:})); else - g = g_cmd (g, _g_tics (args.(Ztics), args.(Ztics), Z, Zmajor{:})); + g = g_cmd (g, _g_tics (getfield(args,Ztics), getfield(args,Ztics), Z, Zmajor{:})); end end end Index: ../octave-forge/extra/gnuplot/inst/g_plot.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_plot.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_plot.m (working copy) @@ -66,7 +66,7 @@ i = 1; keep = ones (1,length(varargin)); # Opts that'll be passed to _g_instantiate while i <= length (varargin) - opt = varargin{i++}; + opt = varargin{i}; i=i+1; ll = length(opt); if ll>=4 \ && (strcmp (opt(ll-3:ll), ".eps") \ @@ -91,7 +91,7 @@ elseif strcmp (opt, "geometry") - geometry = varargin{i++}; + geometry = varargin{i}; i=i+1; keep([i-2,i-1]) = 0; elseif strcmp (opt, "-display") @@ -100,7 +100,7 @@ do_display = 1; keep([i-1]) = 0; else - do_display = varargin{i++}; + do_display = varargin{i}; i=i+1; keep([i-2,i-1]) = 0; endif elseif strcmp (opt, "-color") @@ -109,7 +109,7 @@ do_color = 1; keep([i-1]) = 0; else - do_color = varargin{i++}; + do_color = varargin{i}; i=i+1; keep([i-2,i-1]) = 0; endif else @@ -132,7 +132,7 @@ geometry = strrep (geometry, "x", " "); geometry = eval (["[",geometry,"]"]) endif - geometry ./= 28; + geometry = geometry / 28; endif endif elseif do_png Index: ../octave-forge/extra/gnuplot/inst/myimage.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/myimage.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/myimage.m (working copy) @@ -84,22 +84,22 @@ cnt = 1; # For compat w/ old style - if ! ischar (varargin{cnt}), is_col = varargin{cnt++}; end + if ! ischar (varargin{cnt}), is_col = varargin{cnt}; cnt=cnt+1; end while cnt <= length (varargin) - opt = varargin{cnt++}; + opt = varargin{cnt}; cnt=cnt+1; if ! ischar (opt) error ("Expecting option name, got a %s",typeinfo(opt)) endif switch opt - case "scl", scl = varargin{cnt++}; - case "ROI", roi = varargin{cnt++}; - case "save", filename = varargin{cnt++}; - case "range", vrange = varargin{cnt++}; - case "qrange", qrange = varargin{cnt++}; - case "minsz", minsz = varargin{cnt++}; - case "do_show", do_show = varargin{cnt++}; - case "viewer", viewer = varargin{cnt++}; do_show = 1; + case "scl", scl = varargin{cnt}; cnt=cnt+1; + case "ROI", roi = varargin{cnt}; cnt=cnt+1; + case "save", filename = varargin{cnt}; cnt=cnt+1; + case "range", vrange = varargin{cnt}; cnt=cnt+1; + case "qrange", qrange = varargin{cnt}; cnt=cnt+1; + case "minsz", minsz = varargin{cnt}; cnt=cnt+1; + case "do_show", do_show = varargin{cnt}; cnt=cnt+1; + case "viewer", viewer = varargin{cnt}; cnt=cnt+1; do_show = 1; case "display", viewer = "display"; do_show = 1; case "gimp", viewer = "gimp"; do_show = 1; dont_wait = "&"; case "qiv", viewer = "qiv"; do_show = 1; dont_wait = "&"; @@ -110,17 +110,17 @@ case "is_col", is_col = 1; case "colormap", colormap = 1; if cnt<=length(varargin) && isnumeric(varargin{cnt}) - colormap = varargin{cnt++}; + colormap = varargin{cnt}; cnt=cnt+1; if columns (colormap) != 3 error ("colormap's optional argument has %i != 3 columns", columns(colormap)); end - colormap /= max (colormap(:)); + colormap = colormap / max (colormap(:)); end case "show_range", show_range = 1; - case "scale_sz", show_range = 1; scale_sz = varargin{cnt++}; - case "circle", circle = {circle{:},varargin{cnt++}}; - case "line", line = {line{:},varargin{cnt++}}; - case "text", text = {text{:},varargin{cnt+[0,1]}}; cnt += 2; + case "scale_sz", show_range = 1; scale_sz = varargin{cnt}; cnt=cnt+1; + case "circle", circle = {circle{:},varargin{cnt}}; cnt=cnt+1; + case "line", line = {line{:},varargin{cnt}}; cnt=cnt+1; + case "text", text = {text{:},varargin{cnt+[0,1]}}; cnt = cnt + 2; otherwise error ("Unknown option '%s'", opt); endswitch endwhile @@ -213,19 +213,19 @@ endif ##length(unique(im)) if !is_col || sameScale - im-=imin; + im=im-imin; if irng - im .*= 255/irng; + im = im .* 255/irng; else - im += min (1, max (imin/255,0)); + im = im + min (1, max (imin/255,0)); endif else - for j = 1:3, im(j:3:R,:) -= imin(j); endfor + for j = 1:3, im(j:3:R,:) = im(j:3:R,:) - imin(j); endfor for j = 1:3 if irng(j) - im(j:3:R,:) .*= 255/irng(j); + im(j:3:R,:) = im(j:3:R,:) .* 255/irng(j); else - im(j:3:R,:) += min (1,max (imin(j)/255,0)); + im(j:3:R,:) = im(j:3:R,:) + min (1,max (imin(j)/255,0)); endif endfor endif @@ -235,12 +235,12 @@ if !isempty (roi) - roi *= scl; + roi = roi * scl; #size(im) #[min(im(:)),max(im(:))] highlight = 64; - im(roi(2):roi(4),roi(1):roi(3)) += highlight; - im .*= 255/(255+highlight); + im(roi(2):roi(4),roi(1):roi(3)) = im(roi(2):roi(4),roi(1):roi(3)) + highlight; + im = im .* 255/(255+highlight); #size(im) #[min(im(:)),max(im(:))]; @@ -353,7 +353,7 @@ error ("Arg of type '%s' where string required, in 'text' option",\ typeinfo(text{i+1})); endif - if !length (text{i+1}), i+=2; continue; endif + if !length (text{i+1}), i=i+2; continue; endif ptsz = floor (C0/16); # Size of text characters (in orig image) if length (text{i}) == 3, ptsz = text{i}(3); endif @@ -428,7 +428,7 @@ else printf ("myimage: Hey, there's some 'nan' in the %i'th line argument\n",i); endif - i++; + i=i+1; #wopts endwhile # EOF loop thru lines Index: ../octave-forge/extra/gnuplot/inst/g_demo.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_demo.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_demo.m (working copy) @@ -24,7 +24,7 @@ ## ls(gg.dir) if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (gg, "-wait","COL",2, plot_extras{:}); ##system (["less ",gg.dir,"/x"]) @@ -43,7 +43,7 @@ "set origin 0,0"\ ); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (hh, "-wait",plot_extras{:}); pause @@ -56,7 +56,7 @@ g_locate (_g_instantiate (gg,"COL",4),[0.55, 0.5, 0.45, 0.45])\ ); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (ff, "-wait", plot_extras{:}); pause @@ -70,7 +70,7 @@ ii = g_data (ii, "-step",51, "mygrid", [xx(:),yy(:),zz(:)]); ii = g_cmd (ii, "set hidden3d", "splot 'mygrid' w lines"); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (ii, "-wait",plot_extras{:}); @@ -79,7 +79,7 @@ jj = g_data (jj, "mygrid", zz); jj = g_cmd (jj, "set hidden3d", "splot 'mygrid' matrix w pm3d, 'mygrid' matrix w lines title ''"); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (jj,plot_extras{:}); @@ -98,7 +98,7 @@ "splot [0:9] [0:9] 'checker' binary array=8x8 flipy perp=(0,1,0) center=(4,4,4) format='%uchar' with image"); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (kk,plot_extras{:}); @@ -112,13 +112,13 @@ "splot [-25:25] [-25:25] 'sombrero' matrix using ($1-25):($2-25):($3) with image"); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (ll,plot_extras{:}); zrgb = reshape ([zz(:),-zz(:),abs(zz(:))]',size(zz).*[3,1]); - zrgb -= min(zrgb(:)); - zrgb *= 255/max(zrgb(:)); + zrgb = zrgb - min(zrgb(:)); + zrgb = zrgb * 255/max(zrgb(:)); mm = g_new ("wait",1); mm = g_data(mm, "-uint8","sombrero",zrgb); mm = g_cmd (mm, \ @@ -126,7 +126,7 @@ "plot 'sombrero' binary array=51x51 origin=(-25,-25) format='%uchar%uchar%uchar' with rgbimage"); if save_snapshots - plot_extras = {sprintf(image_tpl, g_demo_plot_cnt++)}; + plot_extras = {sprintf(image_tpl, g_demo_plot_cnt)}; g_demo_plot_cnt=g_demo_plot_cnt+1; end g_plot (mm,plot_extras{:}); Index: ../octave-forge/extra/gnuplot/inst/g_set.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_set.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_set.m (working copy) @@ -13,9 +13,10 @@ _g_check (g); i = 1; while i < length (varargin) - key = varargin{i++}; - value = varargin{i++}; - g.values.(key) = value; + key = varargin{i}; + value = varargin{i}; + i = i + 2; + setfield(g.values,key,value); endwhile endfunction Index: ../octave-forge/extra/gnuplot/inst/_g_tics.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/_g_tics.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/_g_tics.m (working copy) @@ -30,9 +30,9 @@ case "x2", side = "x2"; case "y2", side = "y2"; case "cb", side = "cb"; - case "tpl", tpl = varargin{++n-2}; - case "fmt", fmt = varargin{++n-2}; - case "major", major = varargin{++n-2}; + case "tpl", n=n+1; tpl = varargin{n-2}; + case "fmt", n=n+1; fmt = varargin{n-2}; + case "major", n=n+1; major = varargin{n-2}; otherwise, error ("Unknown option '%s'",opt); end Index: ../octave-forge/extra/gnuplot/inst/g_cmd.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_cmd.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_cmd.m (working copy) @@ -30,11 +30,11 @@ # #################################### if ischar (varargin{i}) # Command is a string - cmds = varargin{i++}; + cmds = varargin{i}; i=i+1; if cmds(1)=="-" # It's an option switch cmds - case "-at", insert_pos = varargin{i++}; + case "-at", insert_pos = varargin{i}; i=i+1; otherwise error ("Unknown option '%s'",cmds); endswitch continue; @@ -61,7 +61,7 @@ [numSta,numEnd] = regexp (cmds(labelEnd+1:end),'^[0-9]+:'); if !isempty(numSta), nPrintArgs = str2num (cmds(labelEnd+(numSta:numEnd-1))); - labelEnd += numEnd; + labelEnd = labelEnd + numEnd; lastPrintArg = firstPrintArg + nPrintArgs - 1; i = lastPrintArg + 1; endif @@ -73,7 +73,7 @@ while lastPrintArg<=length(varargin) \ && ( !ischar (varargin{lastPrintArg}) \ || !strcmp (varargin{lastPrintArg}, label)) - lastPrintArg++; + lastPrintArg = lastPrintArg + 1; endwhile if lastPrintArg > length(varargin) @@ -82,7 +82,7 @@ i = lastPrintArg; else i = lastPrintArg + 1; - lastPrintArg--; + lastPrintArg = lastPrintArg - 1; endif endif if firstPrintArg <= lastPrintArg @@ -106,7 +106,7 @@ printf ("g_cmd: Warning: there's a newline in command\n"); endif ##cmds = [cmds,"\n"] - g.cmds = csplice (g.cmds, insert_pos++, 0, {cmds}); + g.cmds = csplice (g.cmds, insert_pos, 0, {cmds}); insert_pos=insert_pos+1; # #################################### # Command is a gnuplot_object: @@ -116,7 +116,7 @@ if _g_check (varargin{i}) - g2 = _g_instantiate (varargin{i++}); + g2 = _g_instantiate (varargin{i}); i=i+1; if 1 ## && isfield (g2, "local") && g2.local @@ -127,10 +127,10 @@ # remove multiplot commands from g2.cmds: they # would erase what was plotted until now if 1 - i1 = i2 = 1; + i1 = 1; i2 = 1; for i1 = 1:length(g2.cmds) if isempty (regexp (g2.cmds{i1}, 'set\s+multiplot')) - g2.cmds{i2++} = g2.cmds{i1}; + g2.cmds{i2} = g2.cmds{i1}; i2=i2+1; endif endfor g2.cmds = {g2.cmds{1:i2-1}}; @@ -150,7 +150,7 @@ g2.cmds{:}, \ ["cd '",g.dir,"'"]\ }); - insert_pos += 2 + length (g2.cmds); + insert_pos = insert_pos + 2 + length (g2.cmds); #g.cmds ##printf ("After insert\n"); #g @@ -172,7 +172,7 @@ if regexp (g.cmds{i}, 'set\s+multiplot') break endif - i++; + i=i+1; endwhile if i > length (g.cmds) # If there's none, put one at the head. Index: ../octave-forge/extra/gnuplot/inst/_g_image_cmd.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/_g_image_cmd.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/_g_image_cmd.m (working copy) @@ -38,19 +38,19 @@ tmp = va{i}; if ! ischar (tmp), break; end switch tmp - case "flipx", flipx = va{++i}; - case "flipy", flipy = va{++i}; - case "range", grange = zrange = va{++i}; - case "is_col", is_col = va{++i}; - case "xrange", args.xrange = va{++i}; - case "yrange", args.yrange = va{++i}; - case "xyrange", args.yrange = args.xrange = va{++i}; - case "colormap", colormap = va{++i}; + case "flipx", i=i+1; flipx = va{i}; + case "flipy", i=i+1; flipy = va{i}; + case "range", i=i+1; zrange = va{i}; grange = zrange; + case "is_col", i=i+1; is_col = va{i}; + case "xrange", i=i+1; args.xrange = va{i}; + case "yrange", i=i+1; args.yrange = va{i}; + case "xyrange", i=i+1; args.xrange = va{i}; args.yrange = args.xrange; + case "colormap", i=i+1; colormap = va{i}; otherwise break; end - i++; + i=i+1; endwhile -i--; +i=i-1; if is_col == -1 is_col = length (sz) == 3; Index: ../octave-forge/extra/gnuplot/inst/g_data.m =================================================================== --- ../octave-forge/extra/gnuplot/inst/g_data.m (revision 7460) +++ ../octave-forge/extra/gnuplot/inst/g_data.m (working copy) @@ -38,7 +38,7 @@ label = 0; while i <= length(varargin) - name = varargin{i++}; + name = varargin{i}; i=i+1; if !ischar (name) error ("Data arg %i is not char, but %s", i-1, typeinfo (name)); @@ -46,10 +46,10 @@ if strcmp (name,"-step") # Step option - step = varargin{i++}; + step = varargin{i}; i=i+1; continue; elseif strcmp (name,"-stops") # Step option - chosen_stops = [0,varargin{i++}(:)']; + chosen_stops = [0,vec(varargin{i})]; i=i+1; continue; elseif strcmp (name,"-join") # Step option join = 1; @@ -58,7 +58,7 @@ raw_data = 1; continue; elseif strcmp (name,"-label") # Step option - label = varargin{i++}; + label = varargin{i}; i=i+1; continue; elseif name(1) == "-" # Bad option error ("Unknown option '%s'",name); @@ -79,7 +79,7 @@ columns(data), i, columns(varargin{i})); endif endif - i++; + i=i+1; ##size(data) endwhile stops = cumsum(stops); Index: ../octave-forge/extra/pdb/inst/strtoz.m =================================================================== --- ../octave-forge/extra/pdb/inst/strtoz.m (revision 7460) +++ ../octave-forge/extra/pdb/inst/strtoz.m (working copy) @@ -56,9 +56,11 @@ k++; endwhile f = ""; - f(1) = r(k++); + f(1) = r(k); + k += 1; if (k <= L) && islower(r(k)), - f(2) = r(k++); + f(2) = r(k); + k += 1; end; if (k <= L) && isdigit(r(k)), [m,i] = sscanf(r(k:end), "%d", 1); Index: ../octave-forge/extra/pdb/inst/write_pdb.m =================================================================== --- ../octave-forge/extra/pdb/inst/write_pdb.m (revision 7460) +++ ../octave-forge/extra/pdb/inst/write_pdb.m (working copy) @@ -186,14 +186,14 @@ if(isfield(p, "acoord")) natoms = size(p.acoord, 1); if(isfield(p, "atomname")) - atomname = toupper(p.atomname); + atomname = upper(p.atomname); else for i = 1:natoms, atomname(i, :) = " "; endfor endif if(isfield(p, "aresname")) - aresname = toupper(p.aresname); + aresname = upper(p.aresname); else for i = 1:natoms, aresname(i, :) = " "; @@ -268,14 +268,14 @@ if(isfield(p,"hetcoord")) nhet = size(p.hetcoord, 1); if(isfield(p, "hetname")) - hetname = toupper(p.hetname); + hetname = upper(p.hetname); else for i = 1:nhet hetname(i, :) = " "; endfor endif if(isfield(p, "hetresname")) - hetresname = toupper(p.hetresname); + hetresname = upper(p.hetresname); else for i = 1:nhet, hetresname(i, :) = " "; Index: ../octave-forge/extra/pdb/inst/read_pdb.m =================================================================== --- ../octave-forge/extra/pdb/inst/read_pdb.m (revision 7460) +++ ../octave-forge/extra/pdb/inst/read_pdb.m (working copy) @@ -70,10 +70,10 @@ # Heuristics to decipher the element from atomname tmpnam = n(i,isalpha(n(i,:))); if (isfield(elements_struct, tmpnam(1))) - z(i) = elements_struct.(tmpnam(1)); + z(i) = getfield(elements_struct,tmpnam(1)); elseif (length(tmpnam) > 1) - tmpnam(2) = tolower(tmpnam(2)); - z(i) = elements_struct.(tmpnam(1:2)); + tmpnam(2) = lower(tmpnam(2)); + z(i) = getfield(elements_struct,tmpnam(1:2)); else error("Element %s not found", tmpnam); endif Index: ../octave-forge/extra/oct2mat/inst/test_oct2mat.m =================================================================== --- ../octave-forge/extra/oct2mat/inst/test_oct2mat.m (revision 7465) +++ ../octave-forge/extra/oct2mat/inst/test_oct2mat.m (working copy) @@ -224,4 +224,8 @@ mx = vec ( xx + xx' )/2; + + off++; + off ++; + \ No newline at end of file Index: ../octave-forge/extra/oct2mat/inst/oct2mat =================================================================== --- ../octave-forge/extra/oct2mat/inst/oct2mat (revision 7467) +++ ../octave-forge/extra/oct2mat/inst/oct2mat (working copy) @@ -366,6 +366,7 @@ #### builtin-functions gsub(/\Demonstration %d\n
\n", demo_num); demo_footer = "
\n"; Index: ../octave-forge/main/missing-functions/inst/__missingmatlab2txt__.m =================================================================== --- ../octave-forge/main/missing-functions/inst/__missingmatlab2txt__.m (revision 7460) +++ ../octave-forge/main/missing-functions/inst/__missingmatlab2txt__.m (working copy) @@ -74,7 +74,8 @@ thisclass = statstr{allstat(i)+2}; thisclass(isspace (thisclass)) = []; - output{++idx} = sprintf ("%s%s\n", + ++idx; + output{idx} = sprintf ("%s%s\n", thisclass, allname{i}, statstr{allstat(i)+2}); lastwasfun = true (); else Index: ../octave-forge/main/control/inst/BMWengine.m =================================================================== --- ../octave-forge/main/control/inst/BMWengine.m (revision 7460) +++ ../octave-forge/main/control/inst/BMWengine.m (working copy) @@ -51,7 +51,7 @@ print_usage (); endif - switch (tolower (flg)) + switch (lower (flg)) case "unscaled" ## Linearisiertes Modell, nicht skaliert Apu = [ -40.0000 0 0 0 0 Index: ../octave-forge/main/control/inst/rlocus.m =================================================================== --- ../octave-forge/main/control/inst/rlocus.m (revision 7460) +++ ../octave-forge/main/control/inst/rlocus.m (working copy) @@ -162,7 +162,7 @@ nroots = lden - 1; for ii = 1:ngain gain = gvec(ii); - rlpol(1:nroots,ii) = vec(sort (roots (den + gain*num))); + rlpol(1:nroots,ii) = reshape(sort (roots (den + gain*num)),[],1); endfor ## set smoothing tolerance @@ -207,7 +207,7 @@ ngain1 = length (gvec); for ii = (ngain+1):ngain1 gain = gvec(ii); - rlpol(1:nroots,ii) = vec(sort (roots (den + gain*num))); + rlpol(1:nroots,ii) = reshape(sort (roots (den + gain*num)),[],1); endfor [gvec, idx] = sort (gvec); @@ -248,7 +248,8 @@ sigma_A = (sum(olpol) - sum(olzer))/n_A; for i_A=0:n_A-1 phi_A = pi*(2*i_A + 1)/n_A; - args{1,++kk} = [sigma_A sigma_A+len_A*cos(phi_A)]; + kk = kk + 1; + args{1,kk} = [sigma_A sigma_A+len_A*cos(phi_A)]; args{2,kk} = [0 len_A*sin(phi_A)]; if (i_A == 1) args{3,kk} = "k--;asymptotes;"; @@ -259,7 +260,8 @@ endif # locus next for ii = 1:rows(rlpol) - args{1,++kk} = real (rlpol (ii,:)); + kk += 1; + args{1,kk} = real (rlpol (ii,:)); args{2,kk} = imag (rlpol (ii,:)); if (ii == 1) args{3,kk} = "b-;locus;"; @@ -268,23 +270,28 @@ endif endfor # poles and zeros last - args{1,++kk} = real (olpol); + kk += 1; + args{1,kk} = real (olpol); args{2,kk} = imag (olpol); args{3,kk} = "rx;open loop poles;"; if (! isempty (rlzer)) - args{1,++kk} = real (rlzer); + kk += 1; + args{1,kk} = real (rlzer); args{2,kk} = imag (rlzer); args{3,kk} = "go;zeros;"; endif set (gcf,"visible","off"); hplt = plot (args{:}); - set (hplt(kk--), "markersize", 2); + set (hplt(kk), "markersize", 2); + kk -= 1; if (! isempty (rlzer)) - set (hplt(kk--), "markersize", 2); + set (hplt(kk), "markersize", 2); + kk -= 1; endif for ii = 1:rows(rlpol) - set (hplt(kk--), "linewidth", 2); + set (hplt(kk), "linewidth", 2); + kk -= 1; endfor legend ("boxon", 2); grid ("on"); Index: ../octave-forge/main/control/inst/hsvd.m =================================================================== --- ../octave-forge/main/control/inst/hsvd.m (revision 7460) +++ ../octave-forge/main/control/inst/hsvd.m (working copy) @@ -38,7 +38,7 @@ error ("hsvd: first argument must be a LTI system"); endif - if (! strcmp (tolower (prop(1)), "o")) + if (! strcmp (lower (prop(1)), "o")) error ("hsvd: second argument invalid"); endif Index: ../octave-forge/main/control/inst/sigma.m =================================================================== --- ../octave-forge/main/control/inst/sigma.m (revision 7460) +++ ../octave-forge/main/control/inst/sigma.m (working copy) @@ -84,7 +84,7 @@ sv_db = 20 * log10 (sv); ## determine axes - ax_vec = __axis2dlim__ ([w(:), min(sv_db, [], 1)(:); w(:), max(sv_db, [], 1)(:)]); + ax_vec = __axis2dlim__ ([w(:), reshape(min(sv_db, [], 1),[],1); w(:), reshape(max(sv_db, [], 1),[],1)]); ax_vec(1:2) = [min(w), max(w)]; ## determine xlabel Index: ../octave-forge/main/image/devel/__conditional_mark_patterns_lut_fun__.m =================================================================== --- ../octave-forge/main/image/devel/__conditional_mark_patterns_lut_fun__.m (revision 7460) +++ ../octave-forge/main/image/devel/__conditional_mark_patterns_lut_fun__.m (working copy) @@ -64,40 +64,40 @@ endif if(any(op=='K')) - m|=(sx==8)&&( !x5 || !x7 || !x1 || !x3 ); ## bond 11 + m|=((sx==8)&&( !x5 || !x7 || !x1 || !x3 )); ## bond 11 endif if(any(op=='S')) - m|=(sx==2)&&(x1||x3||x5||x7); ## bond 1 - m|=(sx==2)&&(x0||x2||x4||x6); ## bond 2 - m|=(sx==3)&&((x0&&(x1||x7))||(x2&&(x1||x3))||(x4&&(x3||x5))||(x6&&(x5||x7))); ## bond 3 + m=m|((sx==2)&&(x1||x3||x5||x7)); ## bond 1 + m=m|((sx==2)&&(x0||x2||x4||x6)); ## bond 2 + m=m|((sx==3)&&((x0&&(x1||x7))||(x2&&(x1||x3))||(x4&&(x3||x5))||(x6&&(x5||x7)))); ## bond 3 endif if(any(op=='ST')) - m|=(sx==4)&&((x0&&x2&&x3)||(x0&&x2&&x7)||(x1&&x2&&x4)||(x0&&x1&&x6)); ## bond 5 - m|=(sx==4)&&((x0&&x1&&x2)||(x2&&x3&&x4)||(x4&&x5&&x6)||(x6&&x7&&x0)); ## bond 5 - m|=(sx==5)&&((x0&&x2&&x3&&x7)||(x1&&x2&&x4&&x5)); ## bond 6 + m=m|((sx==4)&&((x0&&x2&&x3)||(x0&&x2&&x7)||(x1&&x2&&x4)||(x0&&x1&&x6))); ## bond 5 + m=m|((sx==4)&&((x0&&x1&&x2)||(x2&&x3&&x4)||(x4&&x5&&x6)||(x6&&x7&&x0))); ## bond 5 + m=m|((sx==5)&&((x0&&x2&&x3&&x7)||(x1&&x2&&x4&&x5))); ## bond 6 endif if(any(op=='STK')) - m|=(sx==4)&&(all(X(:,3))||all(X(1,:))||all(X(:,1))||all(X(3,:))); ## bond 4 - m|=(sx==5)&&( \ ## bond 6 + m=m|((sx==4)&&(all(X(:,3))||all(X(1,:))||all(X(:,1))||all(X(3,:)))); ## bond 4 + m=m|((sx==5)&&( \ ## bond 6 (all(X(1,:))&&(x0||x4)) || \ (all(X(:,3))&&(x2||x6)) || \ (all(X(:,1))&&(x2||x6)) || \ - (all(X(3,:))&&(x0||x4)) ); - m|=(sx==6)&&( !(x4||x5||x6) || !(x6||x7||x0) || !(x0||x1||x2) || \ - !(x2||x3||x4) ); ## bond 7 - m|=(sx==6)&&( !any(X(:,1)) || !any(X(3,:)) || !any(X(:,3)) || \ - !any(X(1,:)) ); ## bond 8 - m|=(sx==7)&&( !(x4||(x3&&x5)) || !(x6||(x5&&x7)) || \ - !(x0||(x7&&x1)) || !(x2||(x1&&x3)) ); ## bond 9 - m|=(sx==8)&&( !x0 || !x2 || !x4 || !x6 ); ## bond 10 + (all(X(3,:))&&(x0||x4)) )); + m=m|((sx==6)&&( !(x4||x5||x6) || !(x6||x7||x0) || !(x0||x1||x2) || \ + !(x2||x3||x4) )); ## bond 7 + m=m|((sx==6)&&( !any(X(:,1)) || !any(X(3,:)) || !any(X(:,3)) || \ + !any(X(1,:)) )); ## bond 8 + m=m|((sx==7)&&( !(x4||(x3&&x5)) || !(x6||(x5&&x7)) || \ + !(x0||(x7&&x1)) || !(x2||(x1&&x3)) )); ## bond 9 + m=m|((sx==8)&&( !x0 || !x2 || !x4 || !x6 )); ## bond 10 endif if(any(op=='TK')) ##bond 4 - m|=(sx==3)&&( (x0&&x2) || (x2&&x4) || (x4&&x6) || (x6&&x0) ); + m=m|((sx==3)&&( (x0&&x2) || (x2&&x4) || (x4&&x6) || (x6&&x0) )); endif endfunction Index: ../octave-forge/main/image/devel/__unconditional_mark_patterns_lut_fun__.m =================================================================== --- ../octave-forge/main/image/devel/__unconditional_mark_patterns_lut_fun__.m (revision 7460) +++ ../octave-forge/main/image/devel/__unconditional_mark_patterns_lut_fun__.m (working copy) @@ -67,104 +67,104 @@ if (any(op=='ST')) ## spur - m|=all((X==[0,0,1;0,1,0;0,0,0])(:)); - m|=all((X==[1,0,0;0,1,0;0,0,0])(:)); + m=m|all(vec(X==[0,0,1;0,1,0;0,0,0])); + m=m|all(vec(X==[1,0,0;0,1,0;0,0,0])); ## single 4-connection - m|=all((X==[0,0,0;0,1,0;0,1,0])(:)); - m|=all((X==[0,0,0;0,1,1;0,0,0])(:)); + m=m|all(vec(X==[0,0,0;0,1,0;0,1,0])); + m=m|all(vec(X==[0,0,0;0,1,1;0,0,0])); if (op=='T') ## L cluster - m|=all((X==[0,0,1;0,1,1;0,0,0])(:)); - m|=all((X==[0,1,1;0,1,0;0,0,0])(:)); - m|=all((X==[1,1,0;0,1,0;0,0,0])(:)); - m|=all((X==[1,0,0;1,1,0;0,0,0])(:)); - m|=all((X==[0,0,0;1,1,0;1,0,0])(:)); - m|=all((X==[0,0,0;0,1,0;1,1,0])(:)); - m|=all((X==[0,0,0;0,1,0;0,1,1])(:)); - m|=all((X==[0,0,0;0,1,1;0,0,1])(:)); + m=m|all(vec(X==[0,0,1;0,1,1;0,0,0])); + m=m|all(vec(X==[0,1,1;0,1,0;0,0,0])); + m=m|all(vec(X==[1,1,0;0,1,0;0,0,0])); + m=m|all(vec(X==[1,0,0;1,1,0;0,0,0])); + m=m|all(vec(X==[0,0,0;1,1,0;1,0,0])); + m=m|all(vec(X==[0,0,0;0,1,0;1,1,0])); + m=m|all(vec(X==[0,0,0;0,1,0;0,1,1])); + m=m|all(vec(X==[0,0,0;0,1,1;0,0,1])); endif ## 4-connected offset - m|=all((X==[0,1,1;1,1,0;0,0,0])(:)); - m|=all((X==[1,1,0;0,1,1;0,0,0])(:)); - m|=all((X==[0,1,0;0,1,1;0,0,1])(:)); - m|=all((X==[0,0,1;0,1,1;0,1,0])(:)); + m=m|all(vec(X==[0,1,1;1,1,0;0,0,0])); + m=m|all(vec(X==[1,1,0;0,1,1;0,0,0])); + m=m|all(vec(X==[0,1,0;0,1,1;0,0,1])); + m=m|all(vec(X==[0,0,1;0,1,1;0,1,0])); ## spur corner cluster - m|=all(((X&[1,0,1;1,1,0;1,1,1])==fliplr(eye(3)))(:))&&(x0||x2); - m|=all(((X&[1,0,1;0,1,1;1,1,1])==eye(3))(:))&&(x2||x4); - m|=all(((X&[1,1,1;0,1,1;1,0,1])==fliplr(eye(3)))(:))&&(x4||x6); - m|=all(((X&[1,1,1;1,1,0;1,0,1])==eye(3))(:))&&(x0||x6); + m=m|all(vec((X&[1,0,1;1,1,0;1,1,1])==fliplr(eye(3))))&&(x0||x2); + m=m|all(vec((X&[1,0,1;0,1,1;1,1,1])==eye(3)))&&(x2||x4); + m=m|all(vec((X&[1,1,1;0,1,1;1,0,1])==fliplr(eye(3))))&&(x4||x6); + m=m|all(vec((X&[1,1,1;1,1,0;1,0,1])==eye(3)))&&(x0||x6); ## corner cluster - m|=all((X(1:2,1:2)==ones(2,2))(:)); + m=m|all(vec(X(1:2,1:2)==ones(2,2))); ## tee branch - m|=all(((X&[0,1,1;1,1,1;0,1,1])==[0,1,0;1,1,1;0,0,0])(:)); - m|=all(((X&[1,1,0;1,1,1;1,1,0])==[0,1,0;1,1,1;0,0,0])(:)); - m|=all(((X&[1,1,0;1,1,1;1,1,0])==[0,0,0;1,1,1;0,1,0])(:)); - m|=all(((X&[0,1,1;1,1,1;0,1,1])==[0,0,0;1,1,1;0,1,0])(:)); - m|=all(((X&[0,1,0;1,1,1;1,1,1])==[0,1,0;1,1,0;0,1,0])(:)); - m|=all(((X&[1,1,1;1,1,1;0,1,0])==[0,1,0;1,1,0;0,1,0])(:)); - m|=all(((X&[1,1,1;1,1,1;0,1,0])==[0,1,0;0,1,1;0,1,0])(:)); - m|=all(((X&[0,1,0;1,1,1;1,1,1])==[0,1,0;0,1,1;0,1,0])(:)); + m=m|all(vec((X&[0,1,1;1,1,1;0,1,1])==[0,1,0;1,1,1;0,0,0])); + m=m|all(vec((X&[1,1,0;1,1,1;1,1,0])==[0,1,0;1,1,1;0,0,0])); + m=m|all(vec((X&[1,1,0;1,1,1;1,1,0])==[0,0,0;1,1,1;0,1,0])); + m=m|all(vec((X&[0,1,1;1,1,1;0,1,1])==[0,0,0;1,1,1;0,1,0])); + m=m|all(vec((X&[0,1,0;1,1,1;1,1,1])==[0,1,0;1,1,0;0,1,0])); + m=m|all(vec((X&[1,1,1;1,1,1;0,1,0])==[0,1,0;1,1,0;0,1,0])); + m=m|all(vec((X&[1,1,1;1,1,1;0,1,0])==[0,1,0;0,1,1;0,1,0])); + m=m|all(vec((X&[0,1,0;1,1,1;1,1,1])==[0,1,0;0,1,1;0,1,0])); ## vee branch - m|=all(((X(1:2,1:3)&[1,0,1;0,1,0])==[1,0,1;0,1,0])(:))&&any(X(3,:)); - m|=all(((X(1:3,1:2)&[1,0;0,1;1,0])==[1,0;0,1;1,0])(:))&&any(X(:,3)); - m|=all(((X(2:3,1:3)&[0,1,0;1,0,1])==[0,1,0;1,0,1])(:))&&any(X(1,:)); - m|=all(((X(1:3,2:3)&[0,1;1,0;0,1])==[0,1;1,0;0,1])(:))&&any(X(:,1)); + m=m|all(vec((X(1:2,1:3)&[1,0,1;0,1,0])==[1,0,1;0,1,0])(:))&&any(X(3,:)); + m=m|all(vec((X(1:3,1:2)&[1,0;0,1;1,0])==[1,0;0,1;1,0])(:))&&any(X(:,3)); + m=m|all(vec((X(2:3,1:3)&[0,1,0;1,0,1])==[0,1,0;1,0,1])(:))&&any(X(1,:)); + m=m|all(vec((X(1:3,2:3)&[0,1;1,0;0,1])==[0,1;1,0;0,1])(:))&&any(X(:,1)); ## diagonal branch - m|=all(((X&[0,1,1;1,1,1;1,1,0])==[0,1,0;0,1,1;1,0,0])(:)); - m|=all(((X&[1,1,0;1,1,1;0,1,1])==[0,1,0;1,1,0;0,0,1])(:)); - m|=all(((X&[0,1,1;1,1,1;1,1,0])==[0,0,1;1,1,0;0,1,0])(:)); - m|=all(((X&[1,1,0;1,1,1;0,1,1])==[1,0,0;0,1,1;0,1,0])(:)); + m=m|all(vec((X&[0,1,1;1,1,1;1,1,0])==[0,1,0;0,1,1;1,0,0])); + m=m|all(vec((X&[1,1,0;1,1,1;0,1,1])==[0,1,0;1,1,0;0,0,1])); + m=m|all(vec((X&[0,1,1;1,1,1;1,1,0])==[0,0,1;1,1,0;0,1,0])); + m=m|all(vec((X&[1,1,0;1,1,1;0,1,1])==[1,0,0;0,1,1;0,1,0])); elseif(any(op=='K')) ## spur - m|=all((X==[0,0,0;0,1,0;0,0,1])(:)); - m|=all((X==[0,0,0;0,1,0;1,0,0])(:)); - m|=all((X==[0,0,1;0,1,0;0,0,0])(:)); - m|=all((X==[1,0,0;0,1,0;0,0,0])(:)); + m=m|all(vec(X==[0,0,0;0,1,0;0,0,1])); + m=m|all(vec(X==[0,0,0;0,1,0;1,0,0])); + m=m|all(vec(X==[0,0,1;0,1,0;0,0,0])); + m=m|all(vec(X==[1,0,0;0,1,0;0,0,0])); ## single 4-connection - m|=all((X==[0,0,0;0,1,0;0,1,0])(:)); - m|=all((X==[0,0,0;0,1,1;0,0,0])(:)); - m|=all((X==[0,0,0;1,1,0;0,0,0])(:)); - m|=all((X==[0,1,0;0,1,0;0,0,0])(:)); + m=m|all(vec(X==[0,0,0;0,1,0;0,1,0])); + m=m|all(vec(X==[0,0,0;0,1,1;0,0,0])); + m=m|all(vec(X==[0,0,0;1,1,0;0,0,0])); + m=m|all(vec(X==[0,1,0;0,1,0;0,0,0])); ## L corner - m|=all((X==[0,1,0;0,1,1;0,0,0])(:)); - m|=all((X==[0,1,0;1,1,0;0,0,0])(:)); - m|=all((X==[0,0,0;0,1,1;0,1,0])(:)); - m|=all((X==[0,0,0;1,1,0;0,1,0])(:)); + m=m|all(vec(X==[0,1,0;0,1,1;0,0,0])); + m=m|all(vec(X==[0,1,0;1,1,0;0,0,0])); + m=m|all(vec(X==[0,0,0;0,1,1;0,1,0])); + m=m|all(vec(X==[0,0,0;1,1,0;0,1,0])); ## corner cluster - m|=all((X(1:2,2:3)==ones(2,2))(:)); - m|=all((X(2:3,1:2)==ones(2,2))(:)); - m|=all((X(1:2,1:2)==ones(2,2))(:)); - m|=all((X(2:3,2:3)==ones(2,2))(:)); + m=m|all(vec(X(1:2,2:3)==ones(2,2))); + m=m|all(vec(X(2:3,1:2)==ones(2,2))); + m=m|all(vec(X(1:2,1:2)==ones(2,2))); + m=m|all(vec(X(2:3,2:3)==ones(2,2))); ## tee branch - m|=all(((X&[0,1,0;1,1,1;0,1,1])==[0,1,0;1,1,1;0,0,0])(:)); - m|=all(((X&[0,1,0;1,1,0;0,1,0])==[0,1,0;1,1,0;0,1,0])(:)); - m|=all(((X&[0,0,0;1,1,1;0,1,0])==[0,0,0;1,1,1;0,1,0])(:)); - m|=all(((X&[0,1,0;0,1,1;0,1,0])==[0,1,0;0,1,1;0,1,0])(:)); + m=m|all(vec((X&[0,1,0;1,1,1;0,1,1])==[0,1,0;1,1,1;0,0,0])); + m=m|all(vec((X&[0,1,0;1,1,0;0,1,0])==[0,1,0;1,1,0;0,1,0])); + m=m|all(vec((X&[0,0,0;1,1,1;0,1,0])==[0,0,0;1,1,1;0,1,0])); + m=m|all(vec((X&[0,1,0;0,1,1;0,1,0])==[0,1,0;0,1,1;0,1,0])); ## vee branch (equal to ST version) - m|=all(((X(1:2,1:3)&[1,0,1;0,1,0])==[1,0,1;0,1,0])(:))&&any(X(3,:)); - m|=all(((X(1:3,1:2)&[1,0;0,1;1,0])==[1,0;0,1;1,0])(:))&&any(X(:,3)); - m|=all(((X(2:3,1:3)&[0,1,0;1,0,1])==[0,1,0;1,0,1])(:))&&any(X(1,:)); - m|=all(((X(1:3,2:3)&[0,1;1,0;0,1])==[0,1;1,0;0,1])(:))&&any(X(:,1)); + m=m|all(vec((X(1:2,1:3)&[1,0,1;0,1,0])==[1,0,1;0,1,0]))&&any(X(3,:)); + m=m|all(vec((X(1:3,1:2)&[1,0;0,1;1,0])==[1,0;0,1;1,0]))&&any(X(:,3)); + m=m|all(vec((X(2:3,1:3)&[0,1,0;1,0,1])==[0,1,0;1,0,1]))&&any(X(1,:)); + m=m|all(vec((X(1:3,2:3)&[0,1;1,0;0,1])==[0,1;1,0;0,1]))&&any(X(:,1)); ## diagonal branch (equal to ST version) - m|=all(((X&[0,1,1;1,1,1;1,1,0])==[0,1,0;0,1,1;1,0,0])(:)); - m|=all(((X&[1,1,0;1,1,1;0,1,1])==[0,1,0;1,1,0;0,0,1])(:)); - m|=all(((X&[0,1,1;1,1,1;1,1,0])==[0,0,1;1,1,0;0,1,0])(:)); - m|=all(((X&[1,1,0;1,1,1;0,1,1])==[1,0,0;0,1,1;0,1,0])(:)); + m=m|all(vec((X&[0,1,1;1,1,1;1,1,0])==[0,1,0;0,1,1;1,0,0])); + m=m|all(vec((X&[1,1,0;1,1,1;0,1,1])==[0,1,0;1,1,0;0,0,1])); + m=m|all(vec((X&[0,1,1;1,1,1;1,1,0])==[0,0,1;1,1,0;0,1,0])); + m=m|all(vec((X&[1,1,0;1,1,1;0,1,1])==[1,0,0;0,1,1;0,1,0])); endif Index: ../octave-forge/main/image/inst/regionprops.m =================================================================== --- ../octave-forge/main/image/inst/regionprops.m (revision 7460) +++ ../octave-forge/main/image/inst/regionprops.m (working copy) @@ -158,7 +158,7 @@ case "perimeter" for k = 1:num_labels - retval (k).Perimeter = sum (bwperim (L == k) (:)); + retval (k).Perimeter = sum (reshape (bwperim (L == k),[],1)); endfor case "centroid" @@ -174,7 +174,7 @@ case {"filledarea", "filled_area"} for k = 1:num_labels - retval (k).FilledArea = sum (bwfill (L == k, "holes") (:)); + retval (k).FilledArea = sum (reshape (bwfill (L == k, "holes"), [], 1)); endfor case {"pixellist", "pixel_list"} @@ -197,30 +197,30 @@ case {"maxintensity", "max_intensity"} for k = 1:num_labels - retval (k).MaxIntensity = max (bw (L == k) (:)); + retval (k).MaxIntensity = max (reshape (bw (L == k), [], 1)); endfor case {"minintensity", "min_intensity"} for k = 1:num_labels - retval (k).MaxIntensity = min (bw (L == k) (:)); + retval (k).MaxIntensity = min (reshape (bw (L == k), [], 1)); endfor case {"weightedcentroid", "weighted_centroid"} for k = 1:num_labels [Y, X] = find (L == k); - vals = bw (L == k) (:); + vals = reshape (bw (L == k), [], 1); vals /= sum (vals); retval (k).WeightedCentroid = [dot(X, vals), dot(Y, vals)]; endfor case {"meanintensity", "mean_intensity"} for k = 1:num_labels - retval (k).MaxIntensity = mean (bw (L == k) (:)); + retval (k).MaxIntensity = mean (reshape (bw (L == k), [], 1)); endfor case {"pixelvalues", "pixel_values"} for k = 1:num_labels - retval (k).PixelValues = bw (L == k)(:); + retval (k).PixelValues = reshape (bw (L == k), [], 1); endfor case "orientation" Index: ../octave-forge/main/image/inst/bwmorph.m =================================================================== --- ../octave-forge/main/image/inst/bwmorph.m (revision 7460) +++ ../octave-forge/main/image/inst/bwmorph.m (working copy) @@ -251,7 +251,7 @@ case('clean') ## BW(j,k)=X&&(X0||X1||...||X7) - ## lut=makelut(inline("x(2,2)&&any((x.*[1,1,1;1,0,1;1,1,1])(:))","x"),3); + ## lut=makelut(inline("x(2,2)&&any(vec(x.*[1,1,1;1,0,1;1,1,1]))","x"),3); ## which is the same as... lut=repmat([zeros(16,1);ones(16,1)],16,1); ## identity lut(17)=0; ## isolated to 0 @@ -303,7 +303,7 @@ cmd="BW2=erode(BW, ones(3));"; case('fill') - ## lut=makelut(inline("x(2,2)||(sum((x&[0,1,0;1,0,1;0,1,0])(:))==4)","x"),3); + ## lut=makelut(inline("x(2,2)||(sum(vec(x&[0,1,0;1,0,1;0,1,0]))==4)","x"),3); ## which is the same as... lut=repmat([zeros(16,1);ones(16,1)],16,1); ## identity ## 16 exceptions @@ -329,7 +329,7 @@ return; case('majority') - ## lut=makelut(inline("sum((x&ones(3,3))(:))>=5"),3); + ## lut=makelut(inline("sum(vec(x&ones(3,3)))>=5"),3); lut=logical([0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1; 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;1;0;0;0;1;0;1;1;1; 0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0;0;0;0;0;0;0;1;0;0;0;1;0;1;1;1; @@ -358,7 +358,7 @@ return; case('remove') - ## lut=makelut(inline("x(2,2)&&!(sum((x&[0,1,0;1,1,1;0,1,0])(:))==5)","x"),3); + ## lut=makelut(inline("x(2,2)&&!(sum(vec(x&[0,1,0;1,1,1;0,1,0]))==5)","x"),3); lut=repmat([zeros(16,1);ones(16,1)],16,1); ## identity ## 16 qualifying patterns lut([187,188,191,192,251,252,255,256,443,444,447,448,507,508,511,512])=0; @@ -473,7 +473,7 @@ return; ## no general loop in this case case('spur') - ## lut=makelut(inline("xor(x(2,2),(sum((x&[0,1,0;1,0,1;0,1,0])(:))==0)&&(sum((x&[1,0,1;0,0,0;1,0,1])(:))==1)&&x(2,2))","x"),3); + ## lut=makelut(inline("xor(x(2,2),(sum(vec(x&[0,1,0;1,0,1;0,1,0]))==0)&&(sum(vec(x&[1,0,1;0,0,0;1,0,1]))==1)&&x(2,2))","x"),3); ## which is the same as lut=repmat([zeros(16,1);ones(16,1)],16,1); ## identity lut([18,21,81,273])=0; ## 4 qualifying patterns @@ -549,7 +549,7 @@ while(i<=n) ## for wouldn't work because n can be Inf [BW,BW2]=swap(BW,BW2); eval(cmd); - if(all((BW2==BW)(:))) + if(all(vec(BW2==BW))) break endif i+=1; Index: ../octave-forge/main/image/inst/immaximas.m =================================================================== --- ../octave-forge/main/image/inst/immaximas.m (revision 7460) +++ ../octave-forge/main/image/inst/immaximas.m (working copy) @@ -95,7 +95,7 @@ shift = -w*b./(2*a); # Maxima of quadradic ## Move point - sub{d} += shift; + sub{d} = sub{d} + shift; endfor endif Index: ../octave-forge/main/image/inst/im2col.m =================================================================== --- ../octave-forge/main/image/inst/im2col.m (revision 7460) +++ ../octave-forge/main/image/inst/im2col.m (working copy) @@ -131,9 +131,9 @@ ## TODO: check if we can horzcat([],uint8([10;11])) in a ## future Octave version > 2.1.58 if(isempty(B)) - B=A(i:i+m-1,j:j+n-1)(:); + B=reshape(A(i:i+m-1,j:j+n-1),[],1); else - B=horzcat(B, A(i:i+m-1,j:j+n-1)(:)); + B=horzcat(B, reshape(A(i:i+m-1,j:j+n-1),[],1)); endif endfor endfor @@ -152,9 +152,9 @@ ## TODO: check if we can horzcat([],uint8([10;11])) in a ## future Octave version > 2.1.58 if(isempty(B)) - B=A(i:i+m-1,j:j+n-1)(:); + B=reshape(A(i:i+m-1,j:j+n-1),[],1); else - B=horzcat(B, A(i:i+m-1,j:j+n-1)(:)); + B=horzcat(B, reshape(A(i:i+m-1,j:j+n-1),[],1)); endif endfor endfor Index: ../octave-forge/main/image/inst/imhist.m =================================================================== --- ../octave-forge/main/image/inst/imhist.m (revision 7460) +++ ../octave-forge/main/image/inst/imhist.m (working copy) @@ -62,8 +62,11 @@ if (nargout == 2) [nn,xx] = hist (I(:), bins); - vr_val_cnt = 1; varargout{vr_val_cnt++} = nn; - varargout{vr_val_cnt++} = xx; + vr_val_cnt = 1; + varargout{vr_val_cnt} = nn; + vr_val_cnt += 1; + varargout{vr_val_cnt} = xx; + vr_val_cnt += 1; else hist (I(:), bins); endif Index: ../octave-forge/main/image/inst/imsmooth.m =================================================================== --- ../octave-forge/main/image/inst/imsmooth.m (revision 7460) +++ ../octave-forge/main/image/inst/imsmooth.m (working copy) @@ -228,7 +228,8 @@ endif ## Compute filter h = ceil(3*s); - f = exp( (-(-h:h).^2)./(2*s^2) ); f /= sum(f); + f = exp( (-(-h:h).^2)./(2*s^2) ); + f /= sum(f); ## Pad image I = double(impad(I, h, h, "symmetric")); ## Perform the filtering @@ -327,7 +328,9 @@ endif else sigma_r = 10/255; - if (isinteger(I)), sigma_r *= intmax(C); endif + if (isinteger(I)), + sigma_r *= intmax(C); + endif endif ## Pad image s = max([round(3*sigma_d),1]); @@ -480,7 +483,8 @@ %for i = 1:10 i = 0; while (true) - disp(++i) + i+=1; + disp(i); ms(ms) = ms; #new_ms = ms(ms); if (i >200), break; endif Index: ../octave-forge/main/image/inst/poly2mask.m =================================================================== --- ../octave-forge/main/image/inst/poly2mask.m (revision 7460) +++ ../octave-forge/main/image/inst/poly2mask.m (working copy) @@ -78,8 +78,9 @@ eminy = min (ey); ## minimum y for each edge emaxy = max (ey); ## maximum y for each edge t = (ey == [eminy; eminy]); ## values associated to miny - exminy = ex (:) (t); ## x values associated to min y - exmaxy = ex (:) (!t); ## x values associated to max y + tmp_ex = ex (:) ; + exminy = tmp_ex (t); ## x values associated to min y + exmaxy = tmp_ex (!t); ## x values associated to max y emaxy = emaxy.'; ## we want them vertical now... eminy = eminy.'; m_inv = (exmaxy - exminy)./(emaxy - eminy); ## calculate inverse slope @@ -122,7 +123,7 @@ ## this discards left border of image (this differs from version at ## http://www.cs.rit.edu/~icss571/filling/ which discards right ## border) but keeps an exception when the point is a vertex. - ie (1, :) += (ie (1, :) != ie (2, :)); + ie (1, :) = ie (1, :) + (ie (1, :) != ie (2, :)); ## we'll clip too, just in case m,n is not big enough ie (1, (ie (1, :) < 1)) = 1; @@ -145,7 +146,7 @@ ae = ae ((ae (:, 1) != sl), :); ## update x (x1=x0-1/m) - ae (:, 2) -= ae (:, 3); + ae (:, 2) = ae (:, 2) - ae (:, 3); ## update ae with new values while (sl == ge (gei, 1)) Index: ../octave-forge/main/image/inst/cmunique.m =================================================================== --- ../octave-forge/main/image/inst/cmunique.m (revision 7460) +++ ../octave-forge/main/image/inst/cmunique.m (working copy) @@ -76,7 +76,7 @@ Y=reshape(j,rows(P1),columns(P1)); ## Y is j reshaped case(3) ## RGB case - map=[P1(:,:,1)(:), P1(:,:,2)(:), P1(:,:,3)(:)]; ## build a map with all values + map=[reshape(P1(:,:,1),[],1), reshape(P1(:,:,2),[],1), reshape(P1(:,:,3),[],1)]; ## build a map with all values [newmap,i,j]=unique(map, 'rows'); ## calculate unique colormap Y=reshape(j,rows(P1),columns(P1)); ## Y is j reshaped otherwise Index: ../octave-forge/main/image/inst/readexif.m =================================================================== --- ../octave-forge/main/image/inst/readexif.m (revision 7460) +++ ../octave-forge/main/image/inst/readexif.m (working copy) @@ -239,7 +239,7 @@ ifd.(name) = uintn(value, endian); if debug, printf('%i\n', uintn(value, endian)); end case 05 % 32 bit unsigned rational - ifd.(name) = [uintn(value(1:4,:), endian); uintn(value(5:8,:), endian)]; + setfield(ifd,name,[uintn(value(1:4,:), endian); uintn(value(5:8,:), endian)]); if debug, printf('%i/%i\n',uintn(value(1:4), endian),uintn(value(5:8)), endian); end case 07 % unknown ifd.(name) = uint8(value); @@ -251,7 +251,7 @@ ifd.(name) = intn(value, endian); if debug, printf('%i\n', intn(value, endian)); end case 10 % 32 bit signed rational - ifd.(name) = [intn(value(1:4,:), endian); intn(value(5:8,:), endian)]; + setfield(ifd,name,[intn(value(1:4,:), endian); intn(value(5:8,:), endian)]); if debug, printf('%i/%i\n',intn(value(1:4), endian),intn(value(5:8)), endian); end otherwise printf('%02x ', value); Index: ../octave-forge/main/image/inst/hough_circle.m =================================================================== --- ../octave-forge/main/image/inst/hough_circle.m (revision 7460) +++ ../octave-forge/main/image/inst/hough_circle.m (working copy) @@ -76,7 +76,7 @@ c_cols = max(rad-col+2,1) : min(rad-col+1+size(accum,2), size(circ,2)); ## Update the accumulator array - accum( a_rows, a_cols, j ) += circ ( c_rows, c_cols ); + accum( a_rows, a_cols, j ) = accum( a_rows, a_cols, j ) + circ ( c_rows, c_cols ); endfor endfor endfunction Index: ../octave-forge/main/image/inst/bwboundaries.m =================================================================== --- ../octave-forge/main/image/inst/bwboundaries.m (revision 7460) +++ ../octave-forge/main/image/inst/bwboundaries.m (working copy) @@ -94,7 +94,8 @@ [internal, in_label, lin] = bwboundaries (holes, N, "noholes"); B (end+1:end+lin, 1) = internal; - in_label (in_label != 0) += num_labels; - L += in_label; + ix = in_label != 0; + in_label (ix) = in_label (ix) + num_labels; + L = L + in_label; endif endfunction Index: ../octave-forge/main/image/inst/edge.m =================================================================== --- ../octave-forge/main/image/inst/edge.m (revision 7460) +++ ../octave-forge/main/image/inst/edge.m (working copy) @@ -471,12 +471,12 @@ z0 = f<0; ## Negative [R,C] = size(f); z = zeros(R,C); - z(1:R-1,:) |= z0(2:R,:); ## Grow - z(2:R,:) |= z0(1:R-1,:); - z(:,1:C-1) |= z0(:,2:C); - z(:,2:C) |= z0(:,1:C-1); + z(1:R-1,:) = z(1:R-1,:) | z0(2:R,:); ## Grow + z(2:R,:) = z(2:R,:) | z0(1:R-1,:); + z(:,1:C-1) = z(:,1:C-1) | z0(:,2:C); + z(:,2:C) = z(:,2:C) | z0(:,1:C-1); - z &= !z0; ## "Positive zero-crossings"? + z = z & !z0; ## "Positive zero-crossings"? endfunction ## The 'andy' edge detector that was present in older versions of 'edge'. Index: ../octave-forge/main/image/inst/imperspectivewarp.m =================================================================== --- ../octave-forge/main/image/inst/imperspectivewarp.m (revision 7460) +++ ../octave-forge/main/image/inst/imperspectivewarp.m (working copy) @@ -121,8 +121,10 @@ yl = y2 - y1 + 1; xd = (xl - x)/2; yd = (yl - y)/2; - x1 += xd; x2 -= xd; - y1 += yd; y2 -= yd; + x1 += xd; + x2 -= xd; + y1 += yd; + y2 -= yd; elseif (strcmpi(bbox, "same")) x1 = 1; x2 = x; y1 = 1; y2 = y; Index: ../octave-forge/main/quaternion/inst/qtransv.m =================================================================== --- ../octave-forge/main/quaternion/inst/qtransv.m (revision 7460) +++ ../octave-forge/main/quaternion/inst/qtransv.m (working copy) @@ -43,7 +43,7 @@ endif qr = qib(4); - qimag = vec (qib(1:3)); + qimag = reshape (qib(1:3), [], 1); vb = vec (vb); vi = (2*qr^2 - 1)*vb + 2*qimag*(qimag'*vb) + 2*qr*cross (qimag, vb); Index: ../octave-forge/main/physical-constants/inst/physical_constant.m =================================================================== --- ../octave-forge/main/physical-constants/inst/physical_constant.m (revision 7460) +++ ../octave-forge/main/physical-constants/inst/physical_constant.m (working copy) @@ -1886,7 +1886,7 @@ matches=[]; pmatches=[]; LN=length(arg); - arg=toupper(arg); + arg=upper(arg); %binary search low=1;high=length(unit_data); while ( low <= high ) Index: ../octave-forge/main/optim/inst/nelder_mead_min.m =================================================================== --- ../octave-forge/main/optim/inst/nelder_mead_min.m (revision 7460) +++ ../octave-forge/main/optim/inst/nelder_mead_min.m (working copy) @@ -93,7 +93,7 @@ crit = 0; # Stopping criterion ctl(1) tol = 10*eps; # Stopping test's threshold ctl(2) narg = 1; # Position of minimized arg ctl(3) -maxev = inf; # Max num of func evaluations ctl(4) +maxev = 1e4;inf; # Max num of func evaluations ctl(4) isz = 1; # Initial size ctl(5) rst = 0; # Max # of restarts Index: ../octave-forge/main/optim/inst/d2_min.m =================================================================== --- ../octave-forge/main/optim/inst/d2_min.m (revision 7460) +++ ../octave-forge/main/optim/inst/d2_min.m (working copy) @@ -166,7 +166,8 @@ error ("Function '%s' returns inadequate output", f); end -xbest = x = x(:); +x = x(:); +xbest = x; vold = vbest = nan ; # Values of f hbest = nan ; # Inv. Hessian Index: ../octave-forge/main/optim/inst/cdiff.m =================================================================== --- ../octave-forge/main/optim/inst/cdiff.m (revision 7460) +++ ../octave-forge/main/optim/inst/cdiff.m (working copy) @@ -93,7 +93,7 @@ calstr = strrep(argstr,"dvar",calstr) ; calstr = sprintf("%s(%s)",func,calstr) ; - calstr = sprintf(strcat(" dv = kron (eye(sz(2)), eye(sz(1))(:));\n",\ + calstr = sprintf(strcat(" dv = kron (eye(sz(2)), reshape(eye(sz(1)),[],1));\n",\ " res = %s;\n",\ " sr = size(res)./[2*ps,1];\n",\ " pr = prod (sr);\n",\ @@ -107,7 +107,7 @@ ## "func(var1,dvar%sdv(:,%d:%d),...,varN)," ## calstr = strrep(calstr,"dvar","dvar%sdv(:,(i-1)*sz(2)+1:i*sz(2))")(:)'; - calstr = strrep(calstr,"dvar","dvar%sdv")(:)'; + calstr = reshape(strrep(calstr,"dvar","dvar%sdv"),1,[]); ## func(..,dvar+dv(:,1:sz(2)),..) - func(..) calstr = strcat(calstr,"-",calstr) ; ## strcat(calstr,"-",calstr) ; @@ -120,9 +120,9 @@ " df = zeros(prod (sr),ps); df(:,1) = df0(:);\n",\ " for i = 2:ps,\n",\ " dv(i) = dx; dv(i-1) = 0;\n",\ - " df(:,i) = (%s)(:);\n",\ + " df(:,i) = vec(%s);\n",\ " end;\n",\ - " df ./= 2*dx;\n" + " df = df ./ (2*dx);\n" ), calstr, tmp) ; Index: ../octave-forge/main/optim/inst/gjp.m =================================================================== --- ../octave-forge/main/optim/inst/gjp.m (revision 7460) +++ ../octave-forge/main/optim/inst/gjp.m (working copy) @@ -45,9 +45,10 @@ %% This is a case where I really hate to remain Matlab compatible, %% giving so many indices twice. - m(k, [1:l-1, l+1:end]) = m(k, [1:l-1, l+1:end]) / p; % pivot row - m([1:k-1, k+1:end], [1:l-1, l+1:end]) = ... % except pivot row and col - m([1:k-1, k+1:end], [1:l-1, l+1:end]) - ... - m([1:k-1, k+1:end], l) * m(k, [1:l-1, l+1:end]); - m([1:k-1, k+1:end], l) = - m([1:k-1, k+1:end], l) / p; % pivot column + ik = [1:k-1, k+1:size(m,1)]; + il = [1:l-1, l+1:size(m,2)]; + m(k, il) = m(k, il) / p; % pivot row + m(ik, il) = ... % except pivot row and col + m(ik, il) - m(ik, l) * m(k, il); + m(ik, l) = - m(ik, l) / p; % pivot column m(k, l) = 1 / p; Index: ../octave-forge/main/optim/inst/test_nelder_mead_min_1.m =================================================================== --- ../octave-forge/main/optim/inst/test_nelder_mead_min_1.m (revision 7460) +++ ../octave-forge/main/optim/inst/test_nelder_mead_min_1.m (working copy) @@ -79,9 +79,9 @@ [x2,v,nf] = nelder_mead_min (fname, {x1,x0,z}, ctl) ; t0 = mytic (); - if any (abs (x2-x0)(:) > 100*tol), + if any (abs (vec (x2-x0)) > 100*tol), if verbose || inspect, printf ("not ok %i\n",cnt); end - [max(abs (x2-x0)(:)), 100*tol] + [max(abs (vec (x2-x0))), 100*tol] if inspect, keyboard; end ok = 0 ; else @@ -96,9 +96,9 @@ [x2,v,nf] = nelder_mead_min (fname, {x1,x0,z}) ; t1 = mytic (); - if any (abs (x2-x0)(:) > 100*tol), + if any (abs (vec (x2-x0)) > 100*tol), if verbose || inspect, printf ("not ok %i\n",cnt); end - [max(abs (x2-x0)(:)), 100*tol] + [max(abs (vec (x2-x0))), 100*tol] if inspect, keyboard; end ok = 0 ; else @@ -118,9 +118,9 @@ [x2,v,nf] = nelder_mead_min (fname, {x1,x0,z}, ctl) ; t0 = mytic (); - if any (abs (x2-x1)(:) > 100*tol), + if any (abs ( vec (x2-x1)) > 100*tol), if verbose || inspect, printf ("not ok %i\n",cnt); end - [max(abs (x2-x0)(:)), 100*tol] + [max(abs ( vec (x2-x0))), 100*tol] if inspect, keyboard; end ok = 0 ; else @@ -138,9 +138,9 @@ [x2,v,nf] = nelder_mead_min (fname, {x1,x0,z}, ctl) ; t1 = mytic (); - if any (abs (x2-x1)(:) > tol), + if any (abs (vec (x2-x1)) > tol), if verbose || inspect, printf ("not ok %i\n",cnt); end - [max(abs (x2-x0)(:)), 100*tol] + [max(abs (vec (x2-x0))), 100*tol] if inspect, keyboard; end ok = 0 ; else @@ -155,9 +155,9 @@ [x2bis,vbis,nfbis] = nelder_mead_min (fname, {x1,x0,z}, ctls) ; t1 = mytic (); ## [nf,nfbis] - if any ((x2-x2bis)(:)) + if any (vec(x2-x2bis)) if verbose || inspect, printf ("not ok %i\n",cnt); end - printf (" struct ctl : x2 - x2bis -> %g\n", max(abs (x2-x2bis)(:))); + printf (" struct ctl : x2 - x2bis -> %g\n", max(abs ( vec (x2-x2bis)))); if inspect, keyboard; end ok = 0 ; else @@ -171,9 +171,9 @@ [x2bis,vbis,nfbis] = nelder_mead_min (fname, {x1,x0,z}, "narg", 2) ; t1 = mytic (); ## [nf,nfbis] - if any ((x2-x2bis)(:)) + if any (vec(x2-x2bis)) if verbose || inspect, printf ("not ok %i\n",cnt); end - printf (" named arg : x2 - x2bis -> %g\n", max(abs (x2-x2bis)(:))); + printf (" named arg : x2 - x2bis -> %g\n", max(abs ( vec (x2-x2bis)))); if inspect, keyboard; end ok = 0 ; else Index: ../octave-forge/main/optim/inst/cg_min.m =================================================================== --- ../octave-forge/main/optim/inst/cg_min.m (revision 7460) +++ ../octave-forge/main/optim/inst/cg_min.m (working copy) @@ -129,7 +129,7 @@ if crit == 1, done = tol > (v0 - vnew) / max (1, abs (v0)); else - done = tol > norm ((x-x0)(:)); + done = tol > norm (x(:)-x0(:)); end nline = 1; x0 = x; Index: ../octave-forge/main/optim/inst/test_fminunc_1.m =================================================================== --- ../octave-forge/main/optim/inst/test_fminunc_1.m (revision 7460) +++ ../octave-forge/main/optim/inst/test_fminunc_1.m (working copy) @@ -32,7 +32,7 @@ ## Return value function v = ff(x,y,t) A = [1 -1;1 1]; M = A'*diag([100,1])*A; - v = ((x - y)(1:2))'*M*((x-y)(1:2)) + 1; + v = (x(1:2) - y(1:2))'*M*(x(1:2)-y(1:2)) + 1; endfunction @@ -41,8 +41,8 @@ if nargin < 3, t = 1; end if t == 1, N = length (x); else N = length (y); end A = [1 -1;1 1]; M = A'*diag([100,1])*A; - v = ((x - y)(1:2))'*M*((x-y)(1:2)) + 1; - dv = 2*((x-y)(1:2))'*M; + v = (x(1:2) - y(1:2))'*M*(x(1:2) - y(1:2)) + 1; + dv = 2*(x(1:2) - y(1:2))'*M; d2v = zeros (N); d2v(1:2,1:2) = 2*M; if N>2, dv = [dv, zeros(1,N-2)]; end if t == 2, dv = -dv; end @@ -107,6 +107,7 @@ ## Run, w/ differential returned by function ('jac' option) ########## ## Minimum wrt 'x' is y0 + ## option 'jac' is not supported anymore opt = optimset_compat ("GradO","on"); [xlev,vlev,nlev] = fminunc_compat ("d2ff",x0,opt,y0,1); @@ -119,7 +120,6 @@ elseif verbose, prn ("ok %i\n",cnt); end - ## Use the 'hess' option, when f can return 2nd differential ######### ## Minimum wrt 'x' is y0 opt = optimset_compat ("hessian","on"); Index: ../octave-forge/main/benchmark/inst/benchutil_average.m =================================================================== --- ../octave-forge/main/benchmark/inst/benchutil_average.m (revision 7460) +++ ../octave-forge/main/benchmark/inst/benchutil_average.m (working copy) @@ -27,8 +27,8 @@ end for f = fieldnames (resi).' f = f{1}; - results.(f) = mean ([resi.(f)]); - stddevs.(f) = std ([resi.(f)]); + setfield(results, f, mean ([getfield(resi,f)])); + setfield(stddevs, f, std ([getfield(resi,f)])); end if (benchutil_verbose) @@ -37,7 +37,7 @@ for fn = fieldnames (rdesc).' fn = fn{1}; fprintf ('%s (avg. over %d runs): %f +/- %f%%\n', rdesc.(fn), nruns, ... - results.(fn), 138.59*stddevs.(fn) / results.(fn)); + getfield(results,fn), 138.59*getfield(stddevs,fn) / getfield(results,fn)); end end Index: ../octave-forge/main/statistics/inst/pdist.m =================================================================== --- ../octave-forge/main/statistics/inst/pdist.m (revision 7460) +++ ../octave-forge/main/statistics/inst/pdist.m (working copy) @@ -125,7 +125,7 @@ switch (metric) case "euclidean" d = X(:,Xi) - X(:,Yi); - if (str2num(version()(1:3)) > 3.1) + if (0) % (str2num(version()(1:3)) > 3.1) y = norm (d, "cols"); else y = sqrt (sumsq (d, 1)); @@ -143,7 +143,7 @@ case "cityblock" d = X(:,Xi) - X(:,Yi); - if (str2num(version()(1:3)) > 3.1) + if (0) % (str2num(version()(1:3)) > 3.1) y = norm (d, 1, "cols"); else y = sum (abs (d), 1); @@ -155,7 +155,7 @@ if (nargin > 2) p = varargin{1}; # explicitly assigned endif; - if (str2num(version()(1:3)) > 3.1) + if (0) % (str2num(version()(1:3)) > 3.1) y = norm (d, p, "cols"); else y = (sum ((abs (d)).^p, 1)).^(1/p); @@ -191,7 +191,7 @@ case "chebychev" d = X(:,Xi) - X(:,Yi); - if (str2num(version()(1:3)) > 3.1) + if (0) % (str2num(version()(1:3)) > 3.1) y = norm (d, Inf, "cols"); else y = max (abs (d), [], 1); @@ -207,7 +207,8 @@ idx = 1; for ii = 1:l-1 for jj = ii+1:l - y(idx++) = feval (metric, x(ii,:), x, varargin{:})(jj); + y(idx) = feval (metric, x(ii,:), x, varargin{:})(jj); + idx += 1; endfor endfor endif Index: ../octave-forge/main/statistics/inst/boxplot.m =================================================================== --- ../octave-forge/main/statistics/inst/boxplot.m (revision 7460) +++ ../octave-forge/main/statistics/inst/boxplot.m (working copy) @@ -189,8 +189,8 @@ ## Add caps to the remaining whiskers cap_x = whisker_x; -cap_x(1,:) -= 0.05; -cap_x(2,:) += 0.05; +cap_x(1,:) = cap_x(1,:) - 0.05; +cap_x(2,:) = cap_x(2,:) + 0.05; cap_y = whisker_y([1,1],:); #quartile_x,quartile_y Index: ../octave-forge/main/statistics/inst/linkage.m =================================================================== --- ../octave-forge/main/statistics/inst/linkage.m (revision 7460) +++ ../octave-forge/main/statistics/inst/linkage.m (working copy) @@ -159,7 +159,7 @@ d(c,:) = []; d(:,c) = []; ## The new weight is the sum of the components' weights - weight(r) += weight(c); + weight(r) = weight(r) + weight(c); weight(c) = []; endfor ## Sort the cluster numbers, as Matlab does Index: ../octave-forge/main/statistics/inst/hmmestimate.m =================================================================== --- ../octave-forge/main/statistics/inst/hmmestimate.m (revision 7460) +++ ../octave-forge/main/statistics/inst/hmmestimate.m (working copy) @@ -284,10 +284,10 @@ cstate = 1; for i = 1:len # Count the number of transitions for each state pair - transprobest(cstate, states(i)) ++; + transprobest(cstate, states(i)) = transprobest(cstate, states(i)) + 1; cstate = states (i); # Count the number of outputs for each state output pair - outprobest(cstate, sequence(i)) ++; + outprobest(cstate, sequence(i)) = outprobest(cstate, sequence(i)) + 1; endfor # transprobest and outprobest contain counted numbers Index: ../octave-forge/main/statistics/inst/anovan.m =================================================================== --- ../octave-forge/main/statistics/inst/anovan.m (revision 7460) +++ ../octave-forge/main/statistics/inst/anovan.m (working copy) @@ -224,11 +224,11 @@ gn= gs= gss= zeros((ng+1)^nw, 1); for i=1:ndata # need offset by one for indexing - datapt= data(i); - idx = 1+ int_tbl*g(i,:)'; - gn(idx) +=1; - gs(idx) +=datapt; - gss(idx) +=datapt^2; + datapt = data(i); + idx = 1 + int_tbl*g(i,:)'; + gn(idx) = gn(idx) + 1; + gs(idx) = gs(idx) + datapt; + gss(idx) = gss(idx) + datapt^2; end endfunction Index: ../octave-forge/main/time/inst/busdate.m =================================================================== --- ../octave-forge/main/time/inst/busdate.m (revision 7460) +++ ../octave-forge/main/time/inst/busdate.m (working copy) @@ -63,9 +63,9 @@ while any (mask) ## Only recompute for the days that are not yet business days if isscalar (d) - rd(mask) += d; + rd(mask) = rd(mask) + d; else - rd(mask) += d(mask); + rd(mask) = rd(mask) + d(mask); endif mask(mask) = ~isbusday (rd(mask), hol, wkend); endwhile Index: ../octave-forge/main/time/inst/datesplit.m =================================================================== --- ../octave-forge/main/time/inst/datesplit.m (revision 7460) +++ ../octave-forge/main/time/inst/datesplit.m (working copy) @@ -108,7 +108,7 @@ if (iscellstr(ds)) ds = ds{1}; endif - ds = tolower(deblank(ds)); + ds = lower(deblank(ds)); if (nargin < 1) error("datesplit: no input arguments"); @@ -331,7 +331,7 @@ ## format 3 mmm e.g. Sep if (isempty(match)) - m = strmatch(ds, tolower(__month_names)); + m = strmatch(ds, lower(__month_names)); if (! isempty(m)) match = 1; @@ -383,7 +383,7 @@ if (ischar(m)) m_num = str2num(m); if (isempty(m_num)) - m = strmatch(m, tolower(__month_names)); + m = strmatch(m, lower(__month_names)); else m = m_num; endif Index: ../octave-forge/main/time/inst/thirdwednesday.m =================================================================== --- ../octave-forge/main/time/inst/thirdwednesday.m (revision 7460) +++ ../octave-forge/main/time/inst/thirdwednesday.m (working copy) @@ -49,7 +49,7 @@ wednesdays = nweekdate (3, 4, year, month); dates = datevec (wednesdays); ## adjust the year when the date will wrap - dates(:,1) += dates (:,2) > 9; + dates(:,1) = dates(:,1) + (dates (:,2) > 9); ## adjust the month by three dates(:,2) = mod (dates(:,2) + 2, 12) + 1; enddate = reshape (datenum (dates), sz); Index: ../octave-forge/main/audio/inst/ausave.m =================================================================== --- ../octave-forge/main/audio/inst/ausave.m (revision 7460) +++ ../octave-forge/main/audio/inst/ausave.m (working copy) @@ -49,7 +49,7 @@ if (ext == 0) usage("ausave('filename.ext', x [, fs, sampleformat])"); end - ext = tolower(substr(path, ext+1, length(path)-ext)); + ext = lower(substr(path, ext+1, length(path)-ext)); # determine data size and orientation [samples, channels] = size(data); Index: ../octave-forge/main/audio/inst/auload.m =================================================================== --- ../octave-forge/main/audio/inst/auload.m (revision 7460) +++ ../octave-forge/main/audio/inst/auload.m (working copy) @@ -56,7 +56,7 @@ if (ext == 0) usage('x = auload(filename.ext)'); end - ext = tolower(substr(path, ext+1, length(path)-ext)); + ext = lower(substr(path, ext+1, length(path)-ext)); [file, msg] = fopen(path, 'rb'); if (file == -1) Index: ../octave-forge/main/audio/inst/sound.m =================================================================== --- ../octave-forge/main/audio/inst/sound.m (revision 7460) +++ ../octave-forge/main/audio/inst/sound.m (working copy) @@ -91,7 +91,7 @@ ## trim newline from end of hostname if !isempty(host), host = host(1:length(host)-1); endif endif - islocal = strcmp(tolower(host),tolower(display)); + islocal = strcmp(lower(host),lower(display)); endif ## What do we use for playing? Index: ../octave-forge/main/miscellaneous/inst/colorboard.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/colorboard.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/colorboard.m (working copy) @@ -70,7 +70,7 @@ ## parse options while (nopt > 1) - switch (tolower (varargin{nopt-1})) + switch (lower (varargin{nopt-1})) case "indent" indent = varargin{nopt}; case "spaces" @@ -122,8 +122,8 @@ nc = rows (colors); persistent esc = char (27); - escl = [esc, "["](ones (1, nc), :); - escr = ["m", blanks(spc)](ones (1, nc), :); + escl = ones(nc,1)*[esc, "["]; + escr = ones(nc,1)*["m", blanks(spc)]; colors = [escl, colors, escr].'; @@ -144,9 +144,9 @@ persistent reset = [esc, "[0m"]; indent = blanks (indent); - vline = [indent, hsep(1, ones (1, spc*cm+2))]; - hlinel = [indent, vsep](ones (1, rm), :); - hliner = [reset, vsep](ones (1, rm), :); + vline = [indent, hsep(1, ones (1, spc*cm+2))]; + hlinel = ones(rm,1)*[indent, vsep]; + hliner = ones(rm,1)*[reset, vsep]; oldpso = page_screen_output (0); unwind_protect Index: ../octave-forge/main/miscellaneous/inst/read_options.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/read_options.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/read_options.m (working copy) @@ -123,32 +123,37 @@ opts_orig = opts; -if nocase, opts = tolower (opts); end +if nocase, opts = lower (opts); end nread = 0; optread = 0; while nread < length (args) - oname = name = args{++nread}; + ++nread; + oname = name = args{nread}; if ! ischar (name) # Whoa! Option name is not a string if !optread && length (lextra) op.(lextra{1}) = args{nread}; lextra = lextra(2:length(lextra)); continue - elseif quiet, nread--; return; + elseif quiet, + nread--; + return; else error ("option name in pos %i is not a string",nread); end else optread = 1; end - if nocase, name = tolower (name); end + if nocase, name = lower (name); end ii = findstr ([" ",name], opts); if isempty (ii) # Whoa! Unknown option name - if quiet, nread--; return; + if quiet, + nread--; + return; else error ("unknown option '%s'",oname); end end Index: ../octave-forge/main/miscellaneous/inst/zagzig.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/zagzig.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/zagzig.m (working copy) @@ -55,7 +55,8 @@ n=length(mtrx); ##We create a matrix of the same size as mtrx where odd elements are ##1, others 0. - odd=kron(ones(n,n),eye(2))((1:n),(1:n)); + odd=kron(ones(n,n),eye(2)); + odd=odd((1:n),(1:n)); ##We transpose even elements only. mtrx = (mtrx.*odd)' + (mtrx.*(1-odd)); Index: ../octave-forge/main/miscellaneous/inst/gameoflife.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/gameoflife.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/gameoflife.m (working copy) @@ -41,7 +41,7 @@ C = conv2 (B, ones (3), "same") - B; B1 = C == 3 | (B & C == 2); igen++; - if (isinf (ngen) && all ((B1 == B)(:))) + if (isinf (ngen) && all (vec(B1 == B))) break; endif B = B1; Index: ../octave-forge/main/miscellaneous/inst/xmlwrite.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/xmlwrite.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/xmlwrite.m (working copy) @@ -42,7 +42,7 @@ ## Check file name sn = split(filename, "."); - if !strcmp(tolower(deblank(sn(end,:))), "xml") + if !strcmp(lower(deblank(sn(end,:))), "xml") filename = [filename, ".xml"]; endif @@ -161,7 +161,7 @@ fprintf (fd, "%s\n", indent, opt); _indent = indent; indent = [indent, " "]; for k=1:length(st), - eval(sprintf("nb += xmlwrite (fd, value.%s, \"%s\");", st{k}, st{k})); + eval(sprintf("nb = nb + xmlwrite (fd, value.%s, \"%s\");", st{k}, st{k})); endfor indent = _indent; fprintf (fd, "%s\n", indent); @@ -180,17 +180,6 @@ indent = _indent; fprintf (fd, "%s\n", indent); - elseif islist(value) - ## List type - - fprintf (fd, "%s\n", indent, opt, length(value)); - _indent = indent; indent = [indent, " "]; - for k=1:length(value), - nb += xmlwrite (fd, value{k}); - endfor - indent = _indent; - fprintf (fd, "%s\n", indent); - else ## Unknown type error("unknown type\n"); Index: ../octave-forge/main/miscellaneous/inst/rolldices.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/rolldices.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/rolldices.m (working copy) @@ -65,9 +65,9 @@ endfunction function matrices = getmatrices () - lbrk = [27, 91, 55, 109](ones (1, 3), :); - rbrk = [27, 91, 50, 55, 109](ones (1, 3), :); - spcs = [32, 32; 32, 32; 32, 32]; + lbrk = ones(3,1)*[27, 91, 55, 109]; + rbrk = [27, 91, 50, 55, 109]; + spcs = ones(3,1)*[32, 32; 32, 32; 32, 32]; dchrs = reshape( [" @ @ @ @@ @@ @"; " @ @ @ @ @"; Index: ../octave-forge/main/miscellaneous/inst/solvesudoku.m =================================================================== --- ../octave-forge/main/miscellaneous/inst/solvesudoku.m (revision 7460) +++ ../octave-forge/main/miscellaneous/inst/solvesudoku.m (working copy) @@ -106,7 +107,8 @@ else s1 = sb == 1; ## We want to return as soon as some new singletons are found. - [s(s1), xx] = find (reshape (b, [], 9)(s1, :).'); + tmp = reshape (b, [], 9); + [s(s1), xx] = find (tmp(s1, :).'); if (sum (s(:) != 0) > n0) return; endif @@ -135,7 +137,8 @@ else s1 = sb == 1; [i, k] = find (s1); - [j, xx] = find (permute (b, [2, 1, 3])(:, s1)); + tmp = permute (b, [2, 1, 3]); + [j, xx] = find (tmp(:, s1)); s(sub2ind ([9, 9], i, j)) = k; if (sum (s(:) != 0) > n0) return; @@ -151,7 +154,8 @@ else s1 = reshape (sb == 1, 9, 9); [j, k] = find (s1); - [i, xx] = find (reshape (permute (bb, [1, 3, 2, 4, 5]), 9, 9*9)(:, s1)); + tmp = reshape (permute (bb, [1, 3, 2, 4, 5]), 9, 9*9); + [i, xx] = find (tmp(:, s1)); [i1, i2] = ind2sub ([3, 3], i); [j1, j2] = ind2sub ([3, 3], j); s(sub2ind ([3, 3, 3, 3], i1, j1, i2, j2)) = k; Index: ../octave-forge/main/linear-algebra/inst/bicg.m =================================================================== --- ../octave-forge/main/linear-algebra/inst/bicg.m (revision 7460) +++ ../octave-forge/main/linear-algebra/inst/bicg.m (working copy) @@ -40,7 +40,7 @@ tol = 10e-6; endif if (nargin < 4) - maxit = min([size(A)(1) 20]); + maxit = min([size(A,1) 20]); endif if (nargin < 5) M = eye(size(A)); Index: ../octave-forge/main/linear-algebra/inst/cod.m =================================================================== --- ../octave-forge/main/linear-algebra/inst/cod.m (revision 7460) +++ ../octave-forge/main/linear-algebra/inst/cod.m (working copy) @@ -64,9 +64,11 @@ z = eye (n, class (a)); else ## Permutation inverts row order. - pr = eye (m) (m:-1:1, :); + pr = eye (m); + pr = pr (m:-1:1, :); ## Permutation inverts first m columns order. - pc = eye (n) ([m:-1:1, m+1:n], :); + pc = eye (m); + pc = pc ([m:-1:1, m+1:n], :); ## Make n-by-m matrix, invert first m columns r = (pr * r * pc')'; ## QR factorize again. Index: ../octave-forge/main/linear-algebra/inst/@blksparse/blksparse.m =================================================================== --- ../octave-forge/main/linear-algebra/inst/@blksparse/blksparse.m (revision 7460) +++ ../octave-forge/main/linear-algebra/inst/@blksparse/blksparse.m (working copy) @@ -101,7 +101,8 @@ sv = sv(:,:,fidx); endif - s = struct ("i", i, "j", j, "sv", sv, "siz", siz, "bsiz", size (sv)(1:2)); + sz = size (sv); + s = struct ("i", i, "j", j, "sv", sv, "siz", siz, "bsiz", sz(1:2)); s = class (s, "blksparse"); endfunction Index: ../octave-forge/main/linear-algebra/inst/@blksparse/subsref.m =================================================================== --- ../octave-forge/main/linear-algebra/inst/@blksparse/subsref.m (revision 7460) +++ ../octave-forge/main/linear-algebra/inst/@blksparse/subsref.m (working copy) @@ -48,7 +48,7 @@ if (rem (numel (i), bs) == 0) ba = reshape (i, bs, []); bi = ba(1,:); - if (any (rem (bi, bs) != 1) || any ((ba != bsxfun (@plus, bi, [0:bs-1].'))(:))) + if (any (rem (bi, bs) != 1) || any (vec (ba != bsxfun (@plus, bi, [0:bs-1].')))) error ("blksparse: index must preserve block structure"); else bi = ceil (bi / bs); Index: ../octave-forge/main/linear-algebra/inst/pgmres.m =================================================================== --- ../octave-forge/main/linear-algebra/inst/pgmres.m (revision 7460) +++ ../octave-forge/main/linear-algebra/inst/pgmres.m (working copy) @@ -100,7 +100,8 @@ x = x_old + V(:, 1:restart_it) * Y(1:restart_it); resids(iter) = prec_res_norm ; - restart_it++ ; iter++; + restart_it++; + iter++; endwhile resids = resids(1:iter-1); Index: ../octave-forge/main/odepkg/inst/odepkg_structure_check.m =================================================================== --- ../octave-forge/main/odepkg/inst/odepkg_structure_check.m (revision 7460) +++ ../octave-forge/main/odepkg/inst/odepkg_structure_check.m (working copy) @@ -55,9 +55,9 @@ switch (vfld{vcntarg}) case 'RelTol' - if (isnumeric (vret.(vfld{vcntarg})) && ... - isreal (vret.(vfld{vcntarg})) && ... - all (vret.(vfld{vcntarg}) > 0)) %# 'all' is a MatLab need + if (isnumeric (getfield(vret,vfld{vcntarg})) && ... + isreal (getfield(vret,vfld{vcntarg})) && ... + all (getfield(vret,vfld{vcntarg}) > 0)) %# 'all' is a MatLab need else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -67,8 +67,8 @@ switch (vsol) case {'ode23', 'ode45', 'ode54', 'ode78', ... 'ode23d', 'ode45d', 'ode54d', 'ode78d',} - if (~isscalar (vret.(vfld{vcntarg})) && ... - ~isempty (vret.(vfld{vcntarg}))) + if (~isscalar (getfield(vret,vfld{vcntarg})) && ... + ~isempty (getfield(vret,vfld{vcntarg}))) error ('OdePkg:InvalidParameter', ... 'Value of option "RelTol" must be a scalar'); end @@ -77,9 +77,9 @@ end case 'AbsTol' - if (isnumeric (vret.(vfld{vcntarg})) && ... - isreal (vret.(vfld{vcntarg})) && ... - all (vret.(vfld{vcntarg}) > 0)) + if (isnumeric (getfield(vret,vfld{vcntarg})) && ... + isreal (getfield(vret,vfld{vcntarg})) && ... + all (getfield(vret,vfld{vcntarg}) > 0)) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -87,8 +87,8 @@ end case 'NormControl' - if (strcmp (vret.(vfld{vcntarg}), 'on') || ... - strcmp (vret.(vfld{vcntarg}), 'off')) + if (strcmp (getfield(vret,vfld{vcntarg}), 'on') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'off')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -96,8 +96,8 @@ end case 'NonNegative' - if (isempty (vret.(vfld{vcntarg})) || ... - (isnumeric (vret.(vfld{vcntarg})) && isvector (vret.(vfld{vcntarg})))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (isnumeric (getfield(vret,vfld{vcntarg})) && isvector (getfield(vret,vfld{vcntarg})))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -105,8 +105,8 @@ end case 'OutputFcn' - if (isempty (vret.(vfld{vcntarg})) || ... - isa (vret.(vfld{vcntarg}), 'function_handle')) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + isa (getfield(vret,vfld{vcntarg}), 'function_handle')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -114,9 +114,9 @@ end case 'OutputSel' - if (isempty (vret.(vfld{vcntarg})) || ... - (isnumeric (vret.(vfld{vcntarg})) && isvector (vret.(vfld{vcntarg}))) || ... - isscalar (vret.(vfld{vcntarg}))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (isnumeric (getfield(vret,vfld{vcntarg})) && isvector (getfield(vret,vfld{vcntarg}))) || ... + isscalar (getfield(vret,vfld{vcntarg}))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -124,11 +124,11 @@ end case 'OutputSave' - if (isempty (vret.(vfld{vcntarg})) || ... - (isscalar (vret.(vfld{vcntarg})) && ... - mod (vret.(vfld{vcntarg}), 1) == 0 && ... - vret.(vfld{vcntarg}) > 0) || ... - vret.(vfld{vcntarg}) == Inf) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (isscalar (getfield(vret,vfld{vcntarg})) && ... + mod (getfield(vret,vfld{vcntarg}), 1) == 0 && ... + getfield(vret,vfld{vcntarg}) > 0) || ... + getfield(vret,vfld{vcntarg}) == Inf) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -136,10 +136,10 @@ end case 'Refine' - if (isscalar (vret.(vfld{vcntarg})) && ... - mod (vret.(vfld{vcntarg}), 1) == 0 && ... - vret.(vfld{vcntarg}) >= 0 && ... - vret.(vfld{vcntarg}) <= 5) + if (isscalar (getfield(vret,vfld{vcntarg})) && ... + mod (getfield(vret,vfld{vcntarg}), 1) == 0 && ... + getfield(vret,vfld{vcntarg}) >= 0 && ... + getfield(vret,vfld{vcntarg}) <= 5) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -147,8 +147,8 @@ end case 'Stats' - if (strcmp (vret.(vfld{vcntarg}), 'on') || ... - strcmp (vret.(vfld{vcntarg}), 'off')) + if (strcmp (getfield(vret,vfld{vcntarg}), 'on') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'off')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -156,9 +156,9 @@ end case 'InitialStep' - if (isempty (vret.(vfld{vcntarg})) || ... - (isscalar (vret.(vfld{vcntarg})) && ... - isreal (vret.(vfld{vcntarg})))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (isscalar (getfield(vret,vfld{vcntarg})) && ... + isreal (getfield(vret,vfld{vcntarg})))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -166,9 +166,9 @@ end case 'MaxStep' - if (isempty (vret.(vfld{vcntarg})) || ... - (isscalar (vret.(vfld{vcntarg})) && ... - vret.(vfld{vcntarg}) > 0) ) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (isscalar (getfield(vret,vfld{vcntarg})) && ... + getfield(vret,vfld{vcntarg}) > 0) ) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -176,8 +176,8 @@ end case 'Events' - if (isempty (vret.(vfld{vcntarg})) || ... - isa (vret.(vfld{vcntarg}), 'function_handle')) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + isa (getfield(vret,vfld{vcntarg}), 'function_handle')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -185,10 +185,10 @@ end case 'Jacobian' - if (isempty (vret.(vfld{vcntarg})) || ... - ismatrix (vret.(vfld{vcntarg})) || ... - isa (vret.(vfld{vcntarg}), 'function_handle') || ... - iscell (vret.(vfld{vcntarg}))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + ismatrix (getfield(vret,vfld{vcntarg})) || ... + isa (getfield(vret,vfld{vcntarg}), 'function_handle') || ... + iscell (getfield(vret,vfld{vcntarg}))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -196,9 +196,9 @@ end case 'JPattern' - if (isempty (vret.(vfld{vcntarg})) || ... - isvector (vret.(vfld{vcntarg})) || ... - ismatrix (vret.(vfld{vcntarg}))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + isvector (getfield(vret,vfld{vcntarg})) || ... + ismatrix (getfield(vret,vfld{vcntarg}))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -206,8 +206,8 @@ end case 'Vectorized' - if (strcmp (vret.(vfld{vcntarg}), 'on') || ... - strcmp (vret.(vfld{vcntarg}), 'off')) + if (strcmp (getfield(vret,vfld{vcntarg}), 'on') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'off')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -215,9 +215,9 @@ end case 'Mass' - if (isempty (vret.(vfld{vcntarg})) || ... - ismatrix (vret.(vfld{vcntarg})) || ... - isa (vret.(vfld{vcntarg}), 'function_handle')) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + ismatrix (getfield(vret,vfld{vcntarg})) || ... + isa (getfield(vret,vfld{vcntarg}), 'function_handle')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -225,9 +225,9 @@ end case 'MStateDependence' - if (strcmp (vret.(vfld{vcntarg}), 'none') || ... - strcmp (vret.(vfld{vcntarg}), 'weak') || ... - strcmp (vret.(vfld{vcntarg}), 'strong')) + if (strcmp (getfield(vret,vfld{vcntarg}), 'none') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'weak') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'strong')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -235,9 +235,9 @@ end case 'MvPattern' - if (isempty (vret.(vfld{vcntarg})) || ... - isvector (vret.(vfld{vcntarg})) || ... - ismatrix (vret.(vfld{vcntarg}))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + isvector (getfield(vret,vfld{vcntarg})) || ... + ismatrix (getfield(vret,vfld{vcntarg}))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -245,9 +245,9 @@ end case 'MassSingular' - if (strcmp (vret.(vfld{vcntarg}), 'yes') || ... - strcmp (vret.(vfld{vcntarg}), 'no') || ... - strcmp (vret.(vfld{vcntarg}), 'maybe')) + if (strcmp (getfield(vret,vfld{vcntarg}), 'yes') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'no') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'maybe')) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -255,8 +255,8 @@ end case 'InitialSlope' - if (isempty (vret.(vfld{vcntarg})) || ... - isvector (vret.(vfld{vcntarg}))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + isvector (getfield(vret,vfld{vcntarg}))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -264,10 +264,10 @@ end case 'MaxOrder' - if (isempty (vret.(vfld{vcntarg})) || ... - (mod (vret.(vfld{vcntarg}), 1) == 0 && ... - vret.(vfld{vcntarg}) > 0 && ... - vret.(vfld{vcntarg}) < 8)) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (mod (getfield(vret,vfld{vcntarg}), 1) == 0 && ... + getfield(vret,vfld{vcntarg}) > 0 && ... + getfield(vret,vfld{vcntarg}) < 8)) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -275,9 +275,9 @@ end case 'BDF' - if (isempty (vret.(vfld{vcntarg})) || ... - (strcmp (vret.(vfld{vcntarg}), 'on') || ... - strcmp (vret.(vfld{vcntarg}), 'off'))) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (strcmp (getfield(vret,vfld{vcntarg}), 'on') || ... + strcmp (getfield(vret,vfld{vcntarg}), 'off'))) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -285,9 +285,9 @@ end case 'NewtonTol' - if (isnumeric (vret.(vfld{vcntarg})) && ... - isreal (vret.(vfld{vcntarg})) && ... - all (vret.(vfld{vcntarg}) > 0)) %# 'all' is a MatLab need + if (isnumeric (getfield(vret,vfld{vcntarg})) && ... + isreal (getfield(vret,vfld{vcntarg})) && ... + all (getfield(vret,vfld{vcntarg}) > 0)) %# 'all' is a MatLab need else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... @@ -295,9 +295,9 @@ end case 'MaxNewtonIterations' - if (isempty (vret.(vfld{vcntarg})) || ... - (mod (vret.(vfld{vcntarg}), 1) == 0 && ... - vret.(vfld{vcntarg}) > 0)) + if (isempty (getfield(vret,vfld{vcntarg})) || ... + (mod (getfield(vret,vfld{vcntarg}), 1) == 0 && ... + getfield(vret,vfld{vcntarg}) > 0)) else error ('OdePkg:InvalidParameter', ... 'Unknown parameter name "%s" or no valid parameter value', ... Index: ../octave-forge/main/odepkg/inst/odeget.m =================================================================== --- ../octave-forge/main/odepkg/inst/odeget.m (revision 7460) +++ ../octave-forge/main/odepkg/inst/odeget.m (working copy) @@ -76,18 +76,18 @@ %# Run through number of input arguments given for vcntarg = 1:vint.lengtharg - if ((... - isempty(vint.odestruct.(vint.arguments{vcntarg})) - )||( ... - ischar(vint.odestruct.(vint.arguments{vcntarg})) && ... - strcmp(vint.odestruct.(vint.arguments{vcntarg}),vint.otemplate.(vint.arguments{vcntarg}))... - )||(... - ~ischar(vint.odestruct.(vint.arguments{vcntarg})) && ... - vint.odestruct.(vint.arguments{vcntarg}) == vint.otemplate.(vint.arguments{vcntarg}) ... - )) - if (nargin == 3), vint.returnval{vcntarg} = vint.defaults{vcntarg}; - else, vint.returnval{vcntarg} = vint.odestruct.(vint.arguments{vcntarg}); end - else, vint.returnval{vcntarg} = vint.odestruct.(vint.arguments{vcntarg}); + ode = getfield(vint.odestruct,vint.arguments{vcntarg}); + otp = getfield(vint.otemplate,vint.arguments{vcntarg}); + if (isempty(ode) || ... + ( ischar(ode) && strcmp(ode,otp) ) || ... + (~ischar(ode) && ode == otp )) + if (nargin == 3), + vint.returnval{vcntarg} = vint.defaults{vcntarg}; + else + vint.returnval{vcntarg} = ode; + end + else + vint.returnval{vcntarg} = ode; end end Index: ../octave-forge/main/odepkg/inst/bvp4c.m =================================================================== --- ../octave-forge/main/odepkg/inst/bvp4c.m (revision 7460) +++ ../octave-forge/main/odepkg/inst/bvp4c.m (working copy) @@ -174,23 +174,23 @@ endfunction function x = __bvp4c_solve__ (t, x, h, odefun, bcfun, Nvar, Nint, s) - fun = @( x ) ( [__bvp4c_fun_u__(t, - reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)), + fun = @( x ) ( [reshape(__bvp4c_fun_u__(t, + reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)), reshape(x([1:Nvar*Nint*s]+Nvar*(Nint+1)),Nvar,Nint,s), - h, + h, s, Nint, - Nvar)(:) ; - __bvp4c_fun_K__(t, - reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)), + Nvar), [], 1); + reshape(__bvp4c_fun_K__(t, + reshape(x(1:Nvar*(Nint+1)),Nvar,(Nint+1)), reshape(x([1:Nvar*Nint*s]+Nvar*(Nint+1)),Nvar,Nint,s), odefun, h, s, Nint, - Nvar)(:); - bcfun(reshape(x(1:Nvar*(Nint+1)),Nvar,Nint+1)(:,1), - reshape(x(1:Nvar*(Nint+1)),Nvar,Nint+1)(:,end)); + Nvar), [], 1); + bcfun(reshape(x(1:Nvar), [], 1), + reshape(x(Nvar*Nint+1:Nvar*(Nint+1)),[],1)); ] ); x = fsolve ( fun, x ); Index: ../octave-forge/main/odepkg/inst/odeset.m =================================================================== --- ../octave-forge/main/odepkg/inst/odeset.m (revision 7460) +++ ../octave-forge/main/odepkg/inst/odeset.m (working copy) @@ -139,8 +139,8 @@ vfld = fieldnames (vnew); vlen = length (vfld); for vcntfld = 1:vlen - if (~isempty (vnew.(vfld{vcntfld}))) - vret.(vfld{vcntfld}) = vnew.(vfld{vcntfld}); + if (~isempty (getfield(vnew,vfld{vcntfld}))) + getfield(vret,vfld{vcntfld}) = vnew.(vfld{vcntfld}); end end vret = odepkg_structure_check (vret); Index: ../octave-forge/main/signal/inst/tukeywin.m =================================================================== --- ../octave-forge/main/signal/inst/tukeywin.m (revision 7460) +++ ../octave-forge/main/signal/inst/tukeywin.m (working copy) @@ -64,7 +64,8 @@ otherwise ## cosine-tapered window - t = linspace(0,1,m)(1:end/2)'; + t = linspace(0,1,m); + t = t(1:end/2)'; w = (1 + cos(pi*(2*t/r-1)))/2; w(floor(r*(m-1)/2)+2:end) = 1; w = [w; ones(mod(m,2)); flipud(w)]; Index: ../octave-forge/main/signal/inst/fir2.m =================================================================== --- ../octave-forge/main/signal/inst/fir2.m (revision 7460) +++ ../octave-forge/main/signal/inst/fir2.m (working copy) @@ -101,7 +101,7 @@ ## make sure the grid points stay monotonic in [0,1] f(f<0) = 0; f(f>1) = 1; - f = unique([f(:);basef(idx)(:)]'); + f = unique([f(:);reshape(basef(idx),[],1)]'); ## preserve window shape even though f may have changed m = interp1(basef, basem, f); Index: ../octave-forge/main/signal/inst/firls.m =================================================================== --- ../octave-forge/main/signal/inst/firls.m (revision 7460) +++ ../octave-forge/main/signal/inst/firls.m (working copy) @@ -102,7 +102,7 @@ cos_ints2 = [omega(i1).^2 - omega(i2).^2; ... cos((1:M)' * omega(i2)) - cos((1:M)' * omega(i1))] ./ ... ([2, 1:M]' * (omega(i2) - omega(i1))); - d = [-weight .* pass(i1); weight .* pass(i2)] (:); + d = reshape([-weight .* pass(i1); weight .* pass(i2)],[],1); b = [1, 1./(1:M)]' .* ((kron (cos_ints2, [1, 1]) + cos_ints(1:M+1,:)) * d); ## Having computed the components Q and b of the matrix equation, Index: ../octave-forge/main/signal/inst/zerocrossing.m =================================================================== --- ../octave-forge/main/signal/inst/zerocrossing.m (revision 7460) +++ ../octave-forge/main/signal/inst/zerocrossing.m (working copy) @@ -31,10 +31,11 @@ x = x(:);y = y(:); crossing_intervals = (y(1:end-1).*y(2:end) <= 0); - left_ends = (x(1:end-1))(crossing_intervals); - right_ends = (x(2:end))(crossing_intervals); - left_vals = (y(1:end-1))(crossing_intervals); - right_vals = (y(2:end))(crossing_intervals); + fci = find(crossing_intervals); + left_ends = (x(fci); + right_ends = (x(fci+1); + left_vals = (y(fci); + right_vals = (y(fci+1); mid_points = (left_ends+right_ends)/2; zero_intervals = find(left_vals==right_vals); retval1 = mid_points(zero_intervals); Index: ../octave-forge/main/signal/inst/square.m =================================================================== --- ../octave-forge/main/signal/inst/square.m (revision 7460) +++ ../octave-forge/main/signal/inst/square.m (working copy) @@ -25,7 +25,7 @@ usage('v = square(t [, duty])'); endif - t /= 2*pi; + t /= (2*pi); v = ones(size(t)); v(t-floor(t) >= duty) = -1; Index: ../octave-forge/main/signal/inst/buffer.m =================================================================== --- ../octave-forge/main/signal/inst/buffer.m (revision 7460) +++ ../octave-forge/main/signal/inst/buffer.m (working copy) @@ -119,7 +119,7 @@ endwhile [i, j] = ind2sub([n-p, m], l); if (all ([i, j] == [n-p, m])) - off --; + off--; endif y (:, end - off + 2 : end) = []; else @@ -192,7 +192,7 @@ if (p < 0) opt = max(0, size (y, 2) * (n - p) + opt - l); elseif (p > 0) - opt = y(end-p+1:end)(:); + opt = reshape(y(end-p+1:end),[],1); else opt = []; endif Index: ../octave-forge/main/plot/inst/tricontour.m =================================================================== --- ../octave-forge/main/plot/inst/tricontour.m (revision 7460) +++ ../octave-forge/main/plot/inst/tricontour.m (working copy) @@ -63,11 +63,17 @@ dl=values-level; if (abs(dl(1))<=10*eps) - points(npoints,:)=[x(tri(el,1)),y(tri(el,1))];npoints++;endif + points(npoints,:)=[x(tri(el,1)),y(tri(el,1))]; + npoints++; + endif if (abs(dl(2))<=10*eps) - points(npoints,:)=[x(tri(el,2)),y(tri(el,2))];npoints++;endif + points(npoints,:)=[x(tri(el,2)),y(tri(el,2))]; + npoints++; + endif if (abs(dl(3))<=10*eps) - points(npoints,:)=[x(tri(el,3)),y(tri(el,3))];npoints++;endif + points(npoints,:)=[x(tri(el,3)),y(tri(el,3))]; + npoints++; + endif if (npoints<=2) if ((dl(1)*dl(2)) < 0) # intersection between 1st and 2nd point Index: ../octave-forge/main/plot/inst/dxfwrite.m =================================================================== --- ../octave-forge/main/plot/inst/dxfwrite.m (revision 7460) +++ ../octave-forge/main/plot/inst/dxfwrite.m (working copy) @@ -118,7 +118,8 @@ nb = 0; for i=1:nargin-1 - tmp_pl = varargin{1+nb++}; + tmp_pl = varargin{1+nb}; + nb++; ## Check curve dimension (1, 2 or 3) if columns(tmp_pl) <= 3 Index: ../octave-forge/main/vrml/inst/vrml_group.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_group.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_group.m (working copy) @@ -1,3 +1,5 @@ + + ## Copyright (C) 2002 Etienne Grossmann. All rights reserved. ## ## This program is free software; you can redistribute it and/or modify it @@ -45,3 +47,5 @@ s); endfunction + + Index: ../octave-forge/main/vrml/inst/save_vrml.m =================================================================== --- ../octave-forge/main/vrml/inst/save_vrml.m (revision 7460) +++ ../octave-forge/main/vrml/inst/save_vrml.m (working copy) @@ -1,3 +1,4 @@ + ## Copyright (C) 2002 Etienne Grossmann. All rights reserved. ## ## This program is free software; you can redistribute it and/or modify it @@ -73,10 +74,10 @@ i = 1; -args = nargin; # nargin is now a function -while --args, +args = nargin-1; # nargin is now a function +while args, - tmp = nth (varargin, i++); + tmp = varargin{i++}; if strcmp (tmp, "nobg"), bg_node = ""; elseif strcmp (tmp, "nolight"), @@ -91,6 +92,7 @@ i--; # pos 2.1.39 break; end + --args; end bg_node = [bg_node, lightstr]; ## No path. @@ -112,7 +114,7 @@ if verbose, printf ("save_vrml : %i'th string\n",i); end - fprintf (fid,"%s", nth (varargin, i)) ; + fprintf (fid,"%s", varargin{i}) ; i++ ; end @@ -120,3 +122,4 @@ fclose(fid); endfunction + Index: ../octave-forge/main/vrml/inst/vrml_thick_surf.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_thick_surf.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_thick_surf.m (working copy) @@ -91,7 +91,7 @@ pts = [x(:)';y(:)';z(:)']; -keepp = all (!isnan(pts) & finite(pts)) ; +keepp = all (!isnan(pts) & isfinite(pts)) ; trgs = zeros(3,4*(R-1)*(C-1)) ; @@ -133,30 +133,30 @@ ## (x,y), (x,y+1), (x+1,y) i.e. n, n+1, n+R -trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(2,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(3,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; +trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(2,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(3,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; ## (x+1,y), (x,y+1), (x+1,y+1) i.e. n+R, n+1, n+R+1 tmp += (R-1)*(C-1); -trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; -trgs(2,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(3,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; +trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; +trgs(2,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(3,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; ## (x,y), (x+1,y+1), (x+1,y) i.e. n, n+1, n+R+1 tmp += (R-1)*(C-1); -trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(2,tmp) = ([2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; -trgs(3,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; +trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(2,tmp) = vec([2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; +trgs(3,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; ## (x,y), (x,y+1), (x+1,y+1) i.e. n, n+1, n+R+1 tmp += (R-1)*(C-1); -trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(2,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; -trgs(3,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; +trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(2,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; +trgs(3,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; if ! all(keepp), Index: ../octave-forge/main/vrml/inst/vrml_browse.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_browse.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_browse.m (working copy) @@ -64,7 +64,8 @@ if strcmp (o, "-kill") vrml_kill(); return; elseif strcmp (o, "-bop") # Browser options - bop = [bop," ",varargin{i++}," "]; + bop = [bop," ",varargin{i}," "]; + i++; elseif strcmp (o, "-bg") # Browser options go_to_bg = 1; elseif strcmp (o, "-geometry") # Browser options @@ -134,7 +135,8 @@ [xx, yy] = meshgrid (x, y); r = sqrt (xx .^ 2 + yy .^ 2) + eps; z = 3*sin (r) ./ (2*r); - x /= 4 ; y /= 4 ; + x /= 4 ; + y /= 4 ; ## pix = ones (n) ; ## tmp = [1 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 1 0 0 0 ;\ Index: ../octave-forge/main/vrml/inst/checker_color.m =================================================================== --- ../octave-forge/main/vrml/inst/checker_color.m (revision 7460) +++ ../octave-forge/main/vrml/inst/checker_color.m (working copy) @@ -16,7 +16,7 @@ if prod (size (col)) == 2, col = [1;1;1]*col; elseif prod (size (col)) < 6, # Can't be < 3 because of previous code - col = col(1:3)(:); + col = vec(col(1:3)); if all (col >= 1-eps), col = [col [0;0;0]]; # Black and White else col = [col [1;1;1]]; # X and White end Index: ../octave-forge/main/vrml/inst/vrml_lines.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_lines.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_lines.m (working copy) @@ -46,7 +46,7 @@ while args>=i , - tmp = nth (varargin, i++) ; # pos 2.1.39 + tmp = varargin{i++} ; # pos 2.1.39 if ! ischar(tmp) , error ("vrml_lines : Non-string option : \n") ; ## keyboard @@ -55,7 +55,7 @@ if index(opt1,[" ",tmp," "]) , - tmp2 = nth (varargin, i++); # pos 2.1.39 + tmp2 = varargin{i++}; # pos 2.1.39 ## args-- ; eval([tmp,"=tmp2;"]) ; Index: ../octave-forge/main/vrml/inst/vrml_surf.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_surf.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_surf.m (working copy) @@ -113,8 +113,8 @@ bars = 0; tex = 0; bwid = -1; -DEFcoord = DEFcol = ""; # Give a name to VRML objects - +DEFcoord = ""; DEFcol = ""; # Give a name to VRML objects + if numel (varargin) op1 = " tran col creaseAngle emit colorPerVertex checker DEFcoord DEFcol zcol bwid tex "; @@ -236,8 +236,8 @@ y2(:,C+1) = 2*y2(:,C+1) - y2(:,C); # Duplicate intermediate values 2R x 2C - ii = [1,([1;1]*(2:R))(:)',R+1]; - jj = [1,([1;1]*(2:C))(:)',C+1]; + ii = [1,vec([1;1]*(2:R))',R+1]; + jj = [1,vec([1;1]*(2:C))',C+1]; x2 = x2(ii,jj); y2 = y2(ii,jj); @@ -269,7 +269,7 @@ pts = [x(:)';y(:)';z(:)']; -keepp = all (!isnan(pts) & finite(pts)) ; +keepp = all (!isnan(pts) & isfinite(pts)) ; keepip = find (keepp); if tex [texX,texY] = meshgrid (linspace (0,1,C), linspace (0,1,R)); @@ -318,15 +318,15 @@ tmp = 1:(R-1)*(C-1); - trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; - trgs(2,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; - trgs(3,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; + trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; + trgs(2,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; + trgs(3,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; tmp += (R-1)*(C-1); - trgs(1,tmp) = ([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; - trgs(2,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])(:)'; - trgs(3,tmp) = ([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])(:)'; + trgs(1,tmp) = vec([1:R-1]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; + trgs(2,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[0:C-2])'; + trgs(3,tmp) = vec([ 2:R ]'*ones(1,C-1) + R*ones(R-1,1)*[1:C-1])'; else # Do "upper" triangulation @@ -343,14 +343,14 @@ tmp2 = reshape(1:R*C,R,C); foo1 = z(1:R-1,1:C-1) + z(2:R,2:C); foo2 = z(2:R,1:C-1) + z(1:R-1,2:C); - tmp3 = (!isnan(foo1) & (isnan (foo2) | foo1 > foo2))(:)'; + tmp3 = vec(!isnan(foo1) & (isnan (foo2) | foo1 > foo2))'; - trgs(1,tmp) = tmp2(1:R-1,1:C-1)(:)'; - trgs(2,tmp) = tmp2(2:R,1:C-1)(:)'; + trgs(1,tmp) = vec(tmp2(1:R-1,1:C-1))'; + trgs(2,tmp) = vec(tmp2(2:R,1:C-1))'; trgs(3,tmp) = trgs(1,tmp) + R + tmp3 ; tmp += (R-1)*(C-1); - trgs(1,tmp) = tmp2(1:R-1,2:C)(:)'; - trgs(2,tmp) = tmp2(2:R,2:C)(:)'; + trgs(1,tmp) = vec(tmp2(1:R-1,2:C))'; + trgs(2,tmp) = vec(tmp2(2:R,2:C))'; trgs(3,tmp) = trgs(1,tmp) - R + 1 - tmp3 ; end # EOF "upper" triangulation @@ -401,7 +401,7 @@ if prod (size (col)) == 2, col = [1;1;1]*col; elseif prod (size (col)) < 6, # Can't be < 3 because of previous code - col = col(1:3)(:); + col = vec(col(1:3)); if all (col >= 1-eps), col = [col [0;0;0]]; # Black and White else col = [col [1;1;1]]; # X and White end @@ -436,8 +436,10 @@ nt = (R-1)*(C-1) ; tmp = ! reshape(keepp(trgs),3,2*nt); tmp = all( tmp == kron([0,0;0,1;1,0],ones(1,nt)) ); - trgs(3, find ( tmp(1:nt) & rem (trgs(3,1:nt),R)) )++ ; - trgs(2, nt+ find ( tmp(nt+1:2*nt) & (rem (trgs(3,nt+1:2*nt),R)!=1)) )-- ; + ix = find ( tmp(1:nt) & rem (trgs(3,1:nt),R)); + trgs(3, ix ) = trgs(3, ix ) + 1; + ix = nt+ find ( tmp(nt+1:2*nt) & (rem (trgs(3,nt+1:2*nt),R)!=1)); + trgs(2, ix) = trgs(2, ix) - 1; # Remove whatever can't be kept keept = all (reshape(keepp(trgs),3,2*(R-1)*(C-1))); @@ -445,8 +447,8 @@ tmp = reshape (keepp,R,C); keept = \ all (reshape (tmp(trgs(1:2,:)),2,2*(R-1)*(C-1))) & \ - [(tmp(1:R-1,2:C) | tmp(2:R,2:C))(:)', \ - (tmp(1:R-1,1:C-1) | tmp(2:R,1:C-1))(:)'] ; + [vec(tmp(1:R-1,2:C) | tmp(2:R,2:C))', \ + vec(tmp(1:R-1,1:C-1) | tmp(2:R,1:C-1))'] ; end keepit = find (keept); Index: ../octave-forge/main/vrml/inst/vrml_parallelogram.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_parallelogram.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_parallelogram.m (working copy) @@ -63,7 +63,6 @@ x = [x(:,1:3), x(:,1)-x(:,2)+x(:,3)]; # The facet - s = vrml_faces (x, (1:4)', "col",col, "tran", tran,"emit",emit); # Decoration : balls on vertices Index: ../octave-forge/main/vrml/inst/vrml_Viewpoint.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_Viewpoint.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_Viewpoint.m (working copy) @@ -69,7 +69,7 @@ o = [o(:)'/norm(o), norm(o)]; elseif numel (o) == 4 o(4) = sign(o(4)) * rem (abs (o(4)), pi); - o = [o(1:3)(:)'/norm(o(1:3)), o(4)]; + o = [vec(o(1:3))'/norm(o(1:3)), o(4)]; else error ("Option 'orientation0' has size %i, should be 3 or 4", numel(o)); endif @@ -92,7 +92,7 @@ o = [o(:)'/norm(o), norm(o)]; elseif numel (o) == 4 o(4) = sign(o(4)) * rem (abs (o(4)), pi); - o = [o(1:3)(:)'/norm(o(1:3)), o(4)]; + o = [vec(o(1:3))'/norm(o(1:3)), o(4)]; else error ("Option 'orientation' has size %i, should be 3 or 4", numel(o)); endif Index: ../octave-forge/main/vrml/inst/vrml_cyl.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_cyl.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_cyl.m (working copy) @@ -126,7 +126,7 @@ else t = x(:,i-1) ; if isnan (hcol), hcol = col(:,i); end - arrowcol = [col(:,i) hcol(1:3)(:)]; + arrowcol = [col(:,i) vec(hcol(1:3))]; s = [s,\ vrml_transfo(vrml_arrow ([n,nan,2*rad/n,rad/n],arrowcol,emit),\ t, ax*an)]; Index: ../octave-forge/main/vrml/inst/vrml_TimeSensor.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_TimeSensor.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_TimeSensor.m (working copy) @@ -129,7 +129,7 @@ # plain. elseif isfield (dnode, k) if verbose - printf ("vrml_TimeSensor : Using default type : %s\n",dnode.(k)); + printf ("vrml_TimeSensor : Using default type : %s\n",getfield(dnode,k)); end v = {getfield(dnode,k), v{:}}; end Index: ../octave-forge/main/vrml/inst/vrml_frame.m =================================================================== --- ../octave-forge/main/vrml/inst/vrml_frame.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vrml_frame.m (working copy) @@ -1,3 +1,4 @@ + ## Copyright (C) 2002 Etienne Grossmann. All rights reserved. ## ## This program is free software; you can redistribute it and/or modify it @@ -50,7 +51,7 @@ while args && numeric_args<2, - tmp = nth (varargin, numeric_args + 1); + tmp = varargin{numeric_args + 1}; if ischar (tmp), break; end --args; numeric_args++; @@ -114,23 +115,23 @@ ## d = diam = nan*scale; r2 = r; n = sqrt (sum (r2.^2)); -r2./= [1;1;1] * n; -sz(1,:) .*= n; -sz(3,:) ./= n; -sz(4,:) ./= n; +r2 = r2./([1;1;1] * n); +sz(1,:) = sz(1,:) .* n; +sz(3,:) = sz(3,:) ./ n; +sz(4,:) = sz(4,:) ./ n; tmp = [r2(:,1), null(r2(:,1)')](:,[2,1,3])'; -if det (tmp) < 0, tmp(3,:) *= -1; end +if det (tmp) < 0, tmp(3,:) = -tmp(3,:); end a1 = vrml_transfo (vrml_arrow(sz(:,1),[col(1,:);hcol(1,:)],0),\ [0,0,0],tmp); ## keyboard tmp = [r2(:,2), null(r2(:,2)')](:,[2,1,3])'; -if det (tmp) < 0, tmp(3,:) *= -1; end +if det (tmp) < 0, tmp(3,:) = -tmp(3,:); end a2 = vrml_transfo (vrml_arrow(sz(:,2),[col(2,:);hcol(2,:)],0),\ [0,0,0],tmp); tmp = [r2(:,3), null(r2(:,3)')](:,[2,1,3])'; -if det (tmp) < 0, tmp(3,:) *= -1; end +if det (tmp) < 0, tmp(3,:) = -tmp(3,:); end a3 = vrml_transfo (vrml_arrow(sz(:,3),[col(3,:);hcol(3,:)],0),\ [0,0,0],tmp); @@ -140,3 +141,4 @@ endfunction + Index: ../octave-forge/main/vrml/inst/vmesh.m =================================================================== --- ../octave-forge/main/vrml/inst/vmesh.m (revision 7460) +++ ../octave-forge/main/vrml/inst/vmesh.m (working copy) @@ -218,7 +218,8 @@ ymin = min (y(:)); ymax = max (y(:)); if any (size (lcol) != [nlev,3]) - nlc = prod (szlc = size (lcol)); + szlc = size (lcol); + nlc = prod (szlc); # Transpose colors if all (szlc == [3,nlev]), lcol = lcol'; # Single gray level Index: ../octave-forge/main/zenity/inst/private/zenity_options.m =================================================================== --- ../octave-forge/main/zenity/inst/private/zenity_options.m (revision 7460) +++ ../octave-forge/main/zenity/inst/private/zenity_options.m (working copy) @@ -101,7 +101,8 @@ if (pipelining) break # Move to the next while to process the input endif - param = varargin{narg++}; + param = varargin{narg}; + narg++; if (narg <= numel(varargin)) # Check if we are already in the last index value = varargin{narg}; # this is only for readability later on @@ -304,7 +305,8 @@ if (!pipelining) break # It should have already been processed in the previous while block endif - param = varargin{narg++}; + param = varargin{narg}; + narg++; if (narg <= numel(varargin)) # Check if we are already in the last index value = varargin{narg}; # this is only for readability later on Index: ../octave-forge/main/struct/inst/tars.m =================================================================== --- ../octave-forge/main/struct/inst/tars.m (revision 7460) +++ ../octave-forge/main/struct/inst/tars.m (working copy) @@ -11,5 +11,5 @@ function s = tars(varargin) for i=1:nargin - s.(deblank(argn(i,:))) = varargin{i}; + setfield(s,deblank(argn(i,:)), varargin{i}); end Index: ../octave-forge/main/financial/inst/__fetch_google__.m =================================================================== --- ../octave-forge/main/financial/inst/__fetch_google__.m (revision 7460) +++ ../octave-forge/main/financial/inst/__fetch_google__.m (working copy) @@ -54,7 +54,7 @@ "historical?" ... "q=%s&startdate=%s&enddate=%s&" ... "histperiod=%s&output=csv"], - symbol, fromdatestr, todatestr, periods.(period)); + symbol, fromdatestr, todatestr, getfield(periods,period)); ## FIXME: This would be more efficient if csv2cell could work on ## strings instead of files. [f, success, msg] = urlwrite (geturl, tmpnam ()); Index: ../octave-forge/main/ga/inst/__ga_problem__.m =================================================================== --- ../octave-forge/main/ga/inst/__ga_problem__.m (revision 7460) +++ ../octave-forge/main/ga/inst/__ga_problem__.m (working copy) @@ -78,7 +78,7 @@ ## update state structure state.Population(1:problem.options.PopulationSize, 1:problem.nvars) = NextPopulation; - state.Generation++; + state.Generation=state.Generation+1; state = __ga_problem_update_state_at_each_generation__ (state, problem, private_state); endwhile Index: ../octave-forge/main/econometrics/inst/gmm_results.m =================================================================== --- ../octave-forge/main/econometrics/inst/gmm_results.m (revision 7460) +++ ../octave-forge/main/econometrics/inst/gmm_results.m (working copy) @@ -1,3 +1,4 @@ + # Copyright (C) 2003,2004,2005 Michael Creel # # This program is free software; you can redistribute it and/or modify @@ -88,7 +89,7 @@ df = n - k; if df > 0 clabels = char("Value","df","p-value"); - a = [n*obj_value, df, 1 - chisquare_cdf(n*obj_value, df)]; + a = [n*obj_value, df, 1 - chi2cdf(n*obj_value, df)]; printf("\n"); prettyprint(a, junk, clabels); else @@ -103,3 +104,4 @@ printf("******************************************************\n"); endfunction + Index: ../octave-forge/main/irsa/inst/irsa_act.m =================================================================== --- ../octave-forge/main/irsa/inst/irsa_act.m (revision 7460) +++ ../octave-forge/main/irsa/inst/irsa_act.m (working copy) @@ -96,7 +96,7 @@ nrfyp = rfyp(lpfi+1:Nf); # negative part " " ## special case: fmax is Nyquist-frequency if( iseven && Nf-1 == Nout ) - prfyp(lpfi) *= 2; + prfyp(lpfi) = prfyp(lpfi) * 2; nrfyp = nrfyp(2:Nf-lpfi); Nf--; endif Index: ../octave-forge/main/irsa/inst/irsa_jitsp.m =================================================================== --- ../octave-forge/main/irsa/inst/irsa_jitsp.m (revision 7460) +++ ../octave-forge/main/irsa/inst/irsa_jitsp.m (working copy) @@ -97,7 +97,7 @@ r *= jit; # r is now in [-jit/2,jit/2] jitxp = linspace(0,N-1,N)' * Tm; - jitxp(2:N-1) .+= r; + jitxp(2:N-1) = jitxp(2:N-1) + r; endfunction ## demo section Index: ../octave-forge/main/irsa/inst/irsa_genreal.m =================================================================== --- ../octave-forge/main/irsa/inst/irsa_genreal.m (revision 7460) +++ ../octave-forge/main/irsa/inst/irsa_genreal.m (working copy) @@ -76,7 +76,7 @@ ## Build the spectrum pfyp = amp; # Positive part if( Nphi > 0 ); # Avoid operations with empty arrays - pfyp(2:Namp-nyquist) .*= exp( 2*pi*I*phi ); + pfyp(2:Namp-nyquist) = pfyp(2:Namp-nyquist) .* exp( 2*pi*I*phi ); endif ## Symmetry for real valued signals determines the negative part nfyp = conj(flipud(pfyp(2:Namp-nyquist))); Index: ../octave-forge/main/irsa/inst/irsa_rgenreal.m =================================================================== --- ../octave-forge/main/irsa/inst/irsa_rgenreal.m (revision 7460) +++ ../octave-forge/main/irsa/inst/irsa_rgenreal.m (working copy) @@ -75,17 +75,17 @@ ## Use them to build the spectrum pfyp = amp; # Positive part if( Ne ) - pfyp(Namp) /= 2; + pfyp(Namp) = pfyp(Namp) / 2; endif if( Nphi > 0 ); # Avoid operations with empty arrays - pfyp(2:Namp - Ne) .*= exp( 2*pi*I*phi ); + pfyp(2:Namp - Ne) = pfyp(2:Namp - Ne) .* exp( 2*pi*I*phi ); endif ## Symmetry for real valued signals determines the negative part nfyp = conj(flipud(pfyp(2:Namp))); ## if fmax is the Nyquist frequency of a regular signal fmax and -fmax merge if( regular && (N == (Namp + Nphi)) && Ne ) fxp = [[0:1:fmaxn],-[fmaxn-1:-1:1]]'; - pfyp(Namp) *= 2; + pfyp(Namp) = pfyp(Namp) * 2; nfyp = nfyp(2:fmaxn); merged = 1; else Index: ../octave-forge/main/info-theory/inst/conditionalentropy_YX.m =================================================================== --- ../octave-forge/main/info-theory/inst/conditionalentropy_YX.m (revision 7460) +++ ../octave-forge/main/info-theory/inst/conditionalentropy_YX.m (working copy) @@ -45,7 +45,7 @@ function val=conditionalentropy_YX(XY) val=0.0; - for i=1:size(XY)(1) + for i=1:size(XY,1) Xi = sum(XY(:,i)); val = val + Xi*entropy(XY(:,i)/sum(XY(:,i))); end Index: ../octave-forge/main/specfun/inst/zeta.m =================================================================== --- ../octave-forge/main/specfun/inst/zeta.m (revision 7460) +++ ../octave-forge/main/specfun/inst/zeta.m (working copy) @@ -32,7 +32,7 @@ z(j) = Inf; else for k = 1:100 - z(j) += (-1).^(k-1)./(k.^t(j)); + z(j) = z(j) + (-1).^(k-1)./(k.^t(j)); endfor z(j) = 1./(1-2.^(1-t(j))).*z(j); endif Index: ../octave-forge/main/specfun/inst/ellipj.m =================================================================== --- ../octave-forge/main/specfun/inst/ellipj.m (revision 7460) +++ ../octave-forge/main/specfun/inst/ellipj.m (working copy) @@ -92,8 +92,8 @@ ## For small m, ( Abramowitz and Stegun, Section 16.13 ) idx = ( m < lo ); if any(idx(:)) - uidx = u(idx)(:); - midx = m(idx)(:); + uidx = reshape(u(idx),[],1); + midx = reshape(m(idx),[],1); sin_u = sin(uidx); cos_u = cos(uidx); t = 0.25 * midx .* (uidx - sin_u.*cos_u); @@ -105,8 +105,8 @@ ## For m1 = (1-m) small ( Abramowitz and Stegun, Section 16.15 ) idx = ( m > hi ); if any(idx(:)) - uidx = u(idx)(:); - midx = m(idx)(:); + uidx = reshape(u(idx),[],1); + midx = reshape(m(idx),[],1); sinh_u = sinh(uidx); cosh_u = cosh(uidx); tanh_u = tanh(uidx); @@ -122,8 +122,8 @@ ## ( Abramowitz and Stegun, Section 16.4 ) idx = ( lo <= m & m <= hi ); if any(idx(:)) - uidx = u(idx)(:); - midx = m(idx)(:); + uidx = reshape(u(idx),[],1); + midx = reshape(m(idx),[],1); Nmax = 16; c = a = zeros(sum(idx(:)),Nmax); a(:,1) = ones(sum(idx(:)),1); Index: ../octave-forge/main/io/inst/xlsopen.m =================================================================== --- ../octave-forge/main/io/inst/xlsopen.m (revision 7460) +++ ../octave-forge/main/io/inst/xlsopen.m (working copy) @@ -99,7 +99,7 @@ xlsinterfaces = getxlsinterfaces (xlsinterfaces); # Well, is the requested interface supported on the system? - if (~xlsinterfaces.(toupper (reqinterface))) + if (~getfield(xlsinterfaces,upper (reqinterface))) # No it aint error (" ...but that's not supported!"); endif @@ -307,7 +307,7 @@ for ii=1:size (tmp1, 2) tmp2 = strsplit (char (tmp1(1, ii)), "\\/"); for jj=1:size (entries1, 2) - if (strmatch (entries1{1, jj}, tmp2{size (tmp2, 2)})), ++jpchk1; endif + if (strmatch (entries1{1, jj}, tmp2{size (tmp2, 2)})), jpchk1=jpchk1+1; endif endfor endfor if (jpchk1 > 1) @@ -322,7 +322,7 @@ for ii=1:size (tmp1, 2) tmp2 = strsplit (char (tmp1(1, ii)), "\\/"); for jj=1:size (entries2, 2) - if (strmatch (entries2{1, jj}, tmp2{size (tmp2, 2)})), ++jpchk2; endif + if (strmatch (entries2{1, jj}, tmp2{size (tmp2, 2)})), jpchk2=jpchk2+1; endif endfor endfor if (jpchk2 > 2) printf ("(& OOXML OK) "); endif @@ -344,7 +344,7 @@ for ii=1:size (tmp1, 2) tmp2 = strsplit (char (tmp1(1, ii)), "\\/"); for jj=1:size (entries, 2) - if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), ++jpchk; endif + if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), jpchk=jpchk+1; endif endfor endfor if (jpchk > 0) Index: ../octave-forge/main/io/inst/xlsfinfo.m =================================================================== --- ../octave-forge/main/io/inst/xlsfinfo.m (revision 7460) +++ ../octave-forge/main/io/inst/xlsfinfo.m (working copy) @@ -93,10 +93,12 @@ ws_cnt = 0; ch_cnt = 0; for ii=1:sh_cnt sh_names(ii, 1) = xls.workbook.Sheets(ii).Name; - if (xls.workbook.Sheets(ii).Type == xlWorksheet) - sh_names(ii, 2) = sprintf ("%5d Worksheet # %d", xlWorksheet, ++ws_cnt); - elseif (xls.workbook.Sheets(ii).Type == xlChart) - sh_names(ii, 2) = sprintf ("%5d Chart # %d", xlChart, ++ch_cnt); + if (xls.workbook.Sheets(ii).Type == xlWorksheet) + ++ws_cnt; + sh_names(ii, 2) = sprintf ("%5d Worksheet # %d", xlWorksheet, ws_cnt); + elseif (xls.workbook.Sheets(ii).Type == xlChart) + ++ch_cnt; + sh_names(ii, 2) = sprintf ("%5d Chart # %d", xlChart, ch_cnt); else sh_names(ii, 2) = ' Other sheet type'; endif Index: ../octave-forge/main/io/inst/parse_sp_range.m =================================================================== --- ../octave-forge/main/io/inst/parse_sp_range.m (revision 7460) +++ ../octave-forge/main/io/inst/parse_sp_range.m (working copy) @@ -25,7 +25,7 @@ function [topleft, nrows, ncols, toprow, lcol] = parse_sp_range (range_org) - range = deblank (toupper (range_org)); + range = deblank (upper (range_org)); range_error = 0; nrows = 0; ncols = 0; # Basic checks @@ -75,16 +75,20 @@ if (range_error == 0) # Get left column nr. [st, en] = regexp (leftcol, '\D+'); - lcol = (leftcol(st:st) - 'A' + 1); - while (++st <= en) + lcol = (leftcol(st:st) - 'A' + 1); + ++st; + while (st <= en) lcol = lcol * 26 + (leftcol(st:st) - 'A' + 1); + ++st; endwhile # Get right column nr. [st, en] = regexp (rightcol, '\D+'); rcol = (rightcol(st:st) - 'A' + 1); - while (++st <= en) + ++st; + while (st <= en) rcol = rcol * 26 + (rightcol(st:st) - 'A' + 1); + ++st; endwhile # Check Index: ../octave-forge/main/io/inst/xls2oct.m =================================================================== --- ../octave-forge/main/io/inst/xls2oct.m (revision 7460) +++ ../octave-forge/main/io/inst/xls2oct.m (working copy) @@ -425,13 +425,13 @@ # Crop rawarr from empty outer rows & columns like Excel does emptr = cellfun('isempty', rawarr); irowt = 1; - while (all (emptr(irowt, :))), irowt++; endwhile + while (all (emptr(irowt, :))), irowt=irowt+1; endwhile irowb = nrows; - while (all (emptr(irowb, :))), irowb--; endwhile + while (all (emptr(irowb, :))), irowb=irowb-1; endwhile icoll = 1; - while (all (emptr(:, icoll))), icoll++; endwhile + while (all (emptr(:, icoll))), icoll=icoll+1; endwhile icolr = ncols; - while (all (emptr(:, icolr))), icolr--; endwhile + while (all (emptr(:, icolr))), icolr=icolr-1; endwhile # Crop textarray rawarr = rawarr(irowt:irowb, icoll:icolr); status = 1; @@ -590,13 +590,21 @@ # Crop rawarr from empty outer rows & columns just like Excel does emptr = cellfun('isempty', rawarr); irowt = 1; - while (all (emptr(irowt, :))), irowt++; endwhile + while (all (emptr(irowt, :))), + irowt++; + endwhile irowb = nrows; - while (all (emptr(irowb, :))), irowb--; endwhile + while (all (emptr(irowb, :))), + irowb--; + endwhile icoll = 1; - while (all (emptr(:, icoll))), icoll++; endwhile + while (all (emptr(:, icoll))), + icoll++; + endwhile icolr = ncols; - while (all (emptr(:, icolr))), icolr--; endwhile + while (all (emptr(:, icolr))), + icolr--; + endwhile # Crop textarray rawarr = rawarr(irowt:irowb, icoll:icolr); status = 1; Index: ../octave-forge/main/io/inst/oct2xls.m =================================================================== --- ../octave-forge/main/io/inst/oct2xls.m (revision 7460) +++ ../octave-forge/main/io/inst/oct2xls.m (working copy) @@ -248,7 +248,7 @@ # ... or proposed new sheet name (corresp. to requested sheet *number*) shnm = [shnm "_"]; ii = 0; # Also check if this new augmented sheet name exists... - if (strmatch (shnm1, sh_name)), jj++; endif + if (strmatch (shnm1, sh_name)), jj=jj+1; endif if (jj > 5) # ... but not unlimited times... error (sprintf (" > 5 sheets named [_]Sheet%d already present!", wsh)); endif @@ -586,7 +586,8 @@ ++ii; endwhile if (ii >= 5) error (sprintf( " > 5 sheets named [_]Sheet%d already present!", wsh)); endif - sh = wb.createSheet (strng, nr_of_sheets); ++nr_of_sheets; + sh = wb.createSheet (strng, nr_of_sheets); + ++nr_of_sheets; else sh = wb.getSheet (wsh - 1); # POI sheet count 0-based endif Index: ../octave-forge/main/io/inst/fexist.m =================================================================== --- ../octave-forge/main/io/inst/fexist.m (revision 7460) +++ ../octave-forge/main/io/inst/fexist.m (working copy) @@ -69,11 +69,11 @@ for c = aspec switch (c) case 'r' - at &= (mypid && mstr(1) == c) || (mygid && mstr(4) == c) || mstr(7) == c; + at &= ((mypid && mstr(1) == c) || (mygid && mstr(4) == c) || mstr(7) == c); case 'w' - at &= (mypid && mstr(2) == c) || (mygid && mstr(5) == c) || mstr(8) == c; + at &= ((mypid && mstr(2) == c) || (mygid && mstr(5) == c) || mstr(8) == c); case 'x' - at &= (mypid && mstr(3) == c) || (mygid && mstr(6) == c) || mstr(9) == c; + at &= ((mypid && mstr(3) == c) || (mygid && mstr(6) == c) || mstr(9) == c); otherwise error ("invalid access type spec: %s", c) endswitch Index: ../octave-forge/main/io/inst/xlsread.m =================================================================== --- ../octave-forge/main/io/inst/xlsread.m (revision 7460) +++ ../octave-forge/main/io/inst/xlsread.m (working copy) @@ -147,7 +147,7 @@ endif # A small gesture for Matlab compatibility. JExcelAPI supports BIFF5. - if (~isempty (reqintf) && strcmp (toupper(reqintf), 'BASIC')) + if (~isempty (reqintf) && strcmp (upper(reqintf), 'BASIC')) reqintf= "JXL"; printf ("BASIC (BIFF5) support request translated to JXL. \n"); endif Index: ../octave-forge/main/io/inst/odsopen.m =================================================================== --- ../octave-forge/main/io/inst/odsopen.m (revision 7460) +++ ../octave-forge/main/io/inst/odsopen.m (working copy) @@ -97,9 +97,9 @@ odsinterfaces = getodsinterfaces (odsinterfaces); # Well, is the requested interface supported on the system? - if (~odsinterfaces.(toupper (reqinterface))) + if (~getfield(odsinterfaces,upper (reqinterface))) # No it aint - error (" ...but %s is not supported.", toupper (reqinterface)); + error (" ...but %s is not supported.", upper (reqinterface)); endif endif @@ -253,7 +253,7 @@ for ii=1:size (tmp1, 2) tmp2 = strsplit (char (tmp1(1, ii)), "\\/"); for jj=1:size (entries, 2) - if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), ++jpchk; endif + if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), jpchk=jpchk+1; endif endfor endfor if (jpchk >= 2) # Apparently all requested classes present. @@ -287,7 +287,7 @@ for ii=1:size (tmp1, 2) tmp2 = strsplit (char (tmp1(1, ii)), "\\/"); for jj=1:size (entries, 2) - if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), ++jpchk; endif + if (strmatch (entries{1, jj}, tmp2{size (tmp2, 2)})), jpchk=jpchk+1; endif endfor endfor if (jpchk >= 1) Index: ../octave-forge/main/io/inst/parsecell.m =================================================================== --- ../octave-forge/main/io/inst/parsecell.m (revision 7460) +++ ../octave-forge/main/io/inst/parsecell.m (working copy) @@ -88,13 +88,13 @@ # Clean up text array (find leading / trailing empty # rows & columns) irowt = 1; - while (~any (txtptr(irowt, :))) irowt++; endwhile + while (~any (txtptr(irowt, :))) irowt=irowt+1; endwhile irowb = nrows; - while (~any (txtptr(irowb, :))) irowb--; endwhile + while (~any (txtptr(irowb, :))) irowb=irowb-1; endwhile icoll = 1; - while (~any (txtptr(:, icoll))) icoll++; endwhile + while (~any (txtptr(:, icoll))) icoll=icoll+1; endwhile icolr = ncols; - while (~any (txtptr(:, icolr))) icolr--; endwhile + while (~any (txtptr(:, icolr))) icolr=icolr-1; endwhile # Crop textarray txtarr = txtarr(irowt:irowb, icoll:icolr); lim.txtlimits = [icoll, icolr; irowt, irowb]; @@ -119,13 +119,13 @@ else # Find leading & trailing empty rows irowt = 1; - while (all(emptr(irowt, :))) irowt++; endwhile + while (all(emptr(irowt, :))) irowt=irowt+1; endwhile irowb = nrows; - while (all(emptr(irowb, :))) irowb--; endwhile + while (all(emptr(irowb, :))) irowb=irowb-1; endwhile icoll = 1; - while (all(emptr(:, icoll))) icoll++; endwhile + while (all(emptr(:, icoll))) icoll=icoll+1; endwhile icolr = ncols; - while (all(emptr(:, icolr))) icolr--; endwhile + while (all(emptr(:, icolr))) icolr=icolr-1; endwhile # Put numvalues column by column into temporary storage while # skipping leading & trailing NaN columns & -rows. # As columns are usually bigger chunks than rows & octave Index: ../octave-forge/main/io/inst/ods2oct.m =================================================================== --- ../octave-forge/main/io/inst/ods2oct.m (revision 7460) +++ ../octave-forge/main/io/inst/ods2oct.m (working copy) @@ -180,14 +180,15 @@ # Check user input & find sheet pointer (1-based), using ugly hacks if (~isnumeric (wsh)) # Search in sheet names, match sheet name to sheet number - ii = 0; - while (++ii <= nr_of_sheets && ischar (wsh)) + ii = 1; + while (ii <= nr_of_sheets && ischar (wsh)) # Look in first part of the sheet nodeset sh_name = sheets.item(ii-1).getTableNameAttribute (); if (strcmp (sh_name, wsh)) # Convert local copy of wsh into a number (pointer) wsh = ii; - endif + endif + ii++; endwhile if (ischar (wsh)) error (sprintf ("No worksheet '%s' found in file %s", wsh, ods.filename)); @@ -241,7 +242,8 @@ # Read from worksheet row by row. Row numbers are 0-based while (ii < brow) - row = sh.item(rowcnt++); + row = sh.item(rowcnt); + rowcnt++; nr_of_cells = min (row.getLength (), rcol); rightmcol = max (rightmcol, nr_of_cells); # Keep track of max row length # Read column (cell, "table-cell" in ODS speak) by column @@ -322,13 +324,13 @@ ods.limits= []; else irowt = 1; - while (all (emptr(irowt, :))), irowt++; endwhile + while (all (emptr(irowt, :))), irowt=irowt+1; endwhile irowb = nrows; - while (all (emptr(irowb, :))), irowb--; endwhile + while (all (emptr(irowb, :))), irowb=irowb-1; endwhile icoll = 1; - while (all (emptr(:, icoll))), icoll++; endwhile + while (all (emptr(:, icoll))), icoll=icoll+1; endwhile icolr = ncols; - while (all (emptr(:, icolr))), icolr--; endwhile + while (all (emptr(:, icolr))), icolr=icolr-1; endwhile # Crop textarray rawarr = rawarr(irowt:irowb, icoll:icolr); rstatus = 1; @@ -518,7 +520,7 @@ # Probably empty Cell else # Maybe date / time value. Dirty hack to get values: - mo = strmatch (toupper (val(5:7)), months); + mo = strmatch (upper (val(5:7)), months); dd = str2num (val(9:10)); yy = str2num (val(25:end)); hh = str2num (val(12:13)); @@ -542,13 +544,21 @@ ods.limits= []; else irowt = 1; - while (all (emptr(irowt, :))), irowt++; endwhile + while (all (emptr(irowt, :))), + irowt++; + endwhile irowb = nrows; - while (all (emptr(irowb, :))), irowb--; endwhile + while (all (emptr(irowb, :))), + irowb--; + endwhile icoll = 1; - while (all (emptr(:, icoll))), icoll++; endwhile + while (all (emptr(:, icoll))), + icoll++; + endwhile icolr = ncols; - while (all (emptr(:, icolr))), icolr--; endwhile + while (all (emptr(:, icolr))), + icolr--; + endwhile # Crop textarray rawarr = rawarr(irowt:irowb, icoll:icolr); rstatus = 1; Index: ../octave-forge/main/io/inst/oct2ods.m =================================================================== --- ../octave-forge/main/io/inst/oct2ods.m (revision 7460) +++ ../octave-forge/main/io/inst/oct2ods.m (working copy) @@ -182,14 +182,15 @@ if (~isnumeric (wsh)) # Sheet name specified # Search in sheet names, match sheet name to sheet number. # Beware, 0-based index, 1-based count! - ii = 0; - while (++ii <= nr_of_sheets && ischar (wsh)) + ii = 1; + while (ii <= nr_of_sheets && ischar (wsh)) # Look in first part of the sheet nodeset sh_name = sheets.item(ii-1).getTableNameAttribute (); if (strcmp (sh_name, wsh)) # Convert local copy of wsh into a number (pointer) wsh = ii - 1; - endif + endif + ii = ii + 1; endwhile if (ischar (wsh) && nr_of_sheets < 256) newsh = 1; endif else # Sheet index specified @@ -198,7 +199,8 @@ newsh = 1; elseif (wsh <=nr_of_sheets && wsh > 0) # Existing sheet. Count = 1-based, index = 0-based - --wsh; sh = sheets.item(wsh); + --wsh; + sh = sheets.item(wsh); printf ("Writing to sheet %s\n", sh.getTableNameAttribute()); else error ("oct2ods: illegal sheet number."); Index: ../octave-forge/main/io/inst/getusedrange.m =================================================================== --- ../octave-forge/main/io/inst/getusedrange.m (revision 7460) +++ ../octave-forge/main/io/inst/getusedrange.m (working copy) @@ -355,7 +355,10 @@ # Empty sheet trow = 0; brow = 0; lcol = 0; rcol = 0; else - brow = min (brow, botrow) + 1; ++trow; ++lcol; ++rcol; + brow = min (brow, botrow) + 1; + ++trow; + ++lcol; + ++rcol; endif endfunction Index: ../octave-forge/main/simp/inst/valtol100ToInt.m =================================================================== --- ../octave-forge/main/simp/inst/valtol100ToInt.m (revision 7460) +++ ../octave-forge/main/simp/inst/valtol100ToInt.m (working copy) @@ -24,7 +24,7 @@ error("Wrong number of argument passed to the function"); endif interval = [val, val]; - interval(1) += val * mtol / 100; - interval(2) += val * ptol / 100; + interval(1) = interval(1) + val * mtol / 100; + interval(2) = interval(2) + val * ptol / 100; interval = __checkInt__ (interval); endfunction Index: ../octave-forge/main/general/inst/@dict/subsasgn.m =================================================================== --- ../octave-forge/main/general/inst/@dict/subsasgn.m (revision 7460) +++ ../octave-forge/main/general/inst/@dict/subsasgn.m (working copy) @@ -83,8 +83,8 @@ else d.values(i(mask)) = val(mask); mask = !mask; - [d.keys, i] = sort ([d.keys; ind(mask)(:)]); - d.values = [d.values; val(mask)(:)](i); + [d.keys, i] = sort ([d.keys; vec(ind(mask))]); + d.values = [d.values; vec(val(mask))](i); endif else ## Mass assignment. Probably most of the keys are new ones, so simply Index: ../octave-forge/main/general/inst/@dict/dict.m =================================================================== --- ../octave-forge/main/general/inst/@dict/dict.m (revision 7460) +++ ../octave-forge/main/general/inst/@dict/dict.m (working copy) @@ -69,7 +69,8 @@ keys = sort (keys(:)); values = cell (numel (keys), 1); elseif (isstruct (keys)) - values = struct2cell (keys)(:,:); + # values = struct2cell (keys)(:,:); + values = struct2cell (keys); if (columns (values) != 1) error ("dict: structure must be a scalar"); endif @@ -80,7 +81,7 @@ endif elseif (nargin == 2) [keys, idx] = sort (keys(:)); - values = values (idx)(:); + values = vec (values (idx)); else print_usage (); endif Index: ../octave-forge/main/general/inst/parcellfun.m =================================================================== --- ../octave-forge/main/general/inst/parcellfun.m (revision 7460) +++ ../octave-forge/main/general/inst/parcellfun.m (working copy) @@ -309,7 +309,8 @@ endif endif if (pjobs < njobs) - ijob = ++pjobs; + pjobs += 1; + ijob = pjobs; ## send the next job to the process. fwrite (cmdw(isubp), ijob, "double"); fflush (cmdw(isubp)); Index: ../octave-forge/main/general/inst/private/parcellfun_opts.m =================================================================== --- ../octave-forge/main/general/inst/private/parcellfun_opts.m (revision 7460) +++ ../octave-forge/main/general/inst/private/parcellfun_opts.m (working copy) @@ -36,7 +36,7 @@ if (! ischar (opt)) break; else - opt = tolower (opt); + opt = lower (opt); val = args{nargs}; endif switch (opt) Index: ../octave-forge/main/general/inst/private/chunk_parcellfun.m =================================================================== --- ../octave-forge/main/general/inst/private/chunk_parcellfun.m (revision 7460) +++ ../octave-forge/main/general/inst/private/chunk_parcellfun.m (working copy) @@ -31,7 +31,7 @@ N = numel (args{1}); len_chunk = ceil (N/nchunks); chunk_sizes = len_chunk (ones(1, nchunks)); - chunk_sizes(1:nchunks*len_chunk - N) -= 1; + chunk_sizes(1:nchunks*len_chunk - N) = chunk_sizes(1:nchunks*len_chunk - N) - 1; ## Split argument arrays into chunks (thus making arrays of arrays). chunked_args = cellfun (@(arg) mat2cell (arg(:), chunk_sizes), args, ... Index: ../octave-forge/main/splines/inst/csape.m =================================================================== --- ../octave-forge/main/splines/inst/csape.m (revision 7460) +++ ../octave-forge/main/splines/inst/csape.m (working copy) @@ -152,8 +152,8 @@ ## Use Sherman-Morrison formula to extend the solution ## to the cyclic system. See Numerical Recipes in C, pp 73-75 gamma = - dg(1); - dg(1) -= gamma; - dg(end) -= h(1) * h(1) / gamma; + dg(1) = dg(1) - gamma; + dg(end) = dg(end) - h(1) * h(1) / gamma; z = spdiags([[e(:);0],dg,[0;e(:)]],[-1,0,1],n-1,n-1) \ ... [[gamma; zeros(n-3,1); h(1)],g]; fact = (z(1,2:end) + h(1) * z(end,2:end) / gamma) / ...