comparison extra/ver20/nanmedian.m @ 1035:143f3827b789 octave-forge

Changes to allow use with latest CVS of octave (do_fortran_indexing, etc)
author adb014
date Fri, 12 Sep 2003 14:22:42 +0000
parents 6b33357c7561
children
comparison
equal deleted inserted replaced
1034:e1e0ad43f64b 1035:143f3827b789
30 else 30 else
31 dim = 1; 31 dim = 1;
32 endif 32 endif
33 endif 33 endif
34 if (dim == 2) X = X.'; endif 34 if (dim == 2) X = X.'; endif
35 dfi = do_fortran_indexing; 35 try dfi = do_fortran_indexing;
36 pzoi = prefer_zero_one_indexing; 36 catch dfi = 0;
37 end
38 try wfi = warn_fortran_indexing;
39 catch wfi = 0;
40 end
41 try pzoi = prefer_zero_one_indexing;
42 catch pzoi = 0;
43 end
37 unwind_protect 44 unwind_protect
38 do_fortran_indexing = 1; 45 do_fortran_indexing = 1;
46 warn_fortran_indexing = 0;
39 prefer_zero_one_indexing = 1; 47 prefer_zero_one_indexing = 1;
40 48
41 ## Find lengths of datasets after excluding NaNs; valid datasets 49 ## Find lengths of datasets after excluding NaNs; valid datasets
42 ## are those that are not empty after you remove all the NaNs 50 ## are those that are not empty after you remove all the NaNs
43 n = size(X,1) - sum (isnan(X)); 51 n = size(X,1) - sum (isnan(X));
62 ## for n==6, ceil(3.0+0.4) is 4 and floor(3.0+0.6) is 3 70 ## for n==6, ceil(3.0+0.4) is 4 and floor(3.0+0.6) is 3
63 v(valid) = ( X (colidx + floor(n(valid)./2+0.6)) ... 71 v(valid) = ( X (colidx + floor(n(valid)./2+0.6)) ...
64 + X (colidx + ceil(n(valid)./2+0.4)) ) ./ 2; 72 + X (colidx + ceil(n(valid)./2+0.4)) ) ./ 2;
65 unwind_protect_cleanup 73 unwind_protect_cleanup
66 do_fortran_indexing = dfi; 74 do_fortran_indexing = dfi;
75 warn_fortran_indexing = wfi;
67 prefer_zero_one_indexing = pzoi; 76 prefer_zero_one_indexing = pzoi;
68 end_unwind_protect 77 end_unwind_protect
69 if (dim == 2) v = v.'; endif 78 if (dim == 2) v = v.'; endif
70 endif 79 endif
71 endfunction 80 endfunction