# HG changeset patch # User John W. Eaton # Date 1418051915 18000 # Node ID 9464cfeede2bb7b400fed7a225276064f13d397b # Parent 385499581a5e6d361f1c48a408ff6b5773bead7a# Parent 1572b5276b9a64b0af9b8250703d76678873720e maint: Periodic merge of gui-release to default. diff --git a/libinterp/corefcn/load-save.cc b/libinterp/corefcn/load-save.cc --- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -876,6 +876,11 @@ orig_fname.c_str ()); } } + else + { + error ("load: unable to determine file format of '%s'", + orig_fname.c_str ()); + } } return retval; diff --git a/scripts/general/interp1.m b/scripts/general/interp1.m --- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -376,7 +376,8 @@ minx = min (x(1), x(nx)); maxx = max (x(1), x(nx)); - outliers = xi < minx | ! (xi <= maxx); # this even catches NaNs + xi = reshape (xi, szx); + outliers = xi < minx | ! (xi <= maxx); # this even catches NaNs if (size_equal (outliers, yi)) yi(outliers) = extrap; yi = reshape (yi, szx); @@ -385,6 +386,7 @@ else yi(outliers.') = extrap; endif + endif endfunction @@ -749,6 +751,8 @@ %!assert (interp1 ([1:5],[3:2:11],[0,6],"previous","extrap"), [3, 11], eps) %!assert (interp1 ([1:5],[3:2:11],[0,6],"next","extrap"), [3, 11], eps) %!assert (interp1 (xp, yp, [-1, max(xp)+1],"linear",5), [5, 5]) +%!assert (interp1 ([0,1],[1,0],[0.1,0.9;0.2,1.1]), [0.9 0.1; 0.8 NA], eps) +%!assert (interp1 ([0,1],[1,0],[0.1,0.9;0.2,1]), [0.9 0.1; 0.8 0], eps) ## Basic sanity checks %!assert (interp1 (1:2,1:2,1.4,"nearest"), 1) diff --git a/scripts/time/datevec.m b/scripts/time/datevec.m --- a/scripts/time/datevec.m +++ b/scripts/time/datevec.m @@ -155,7 +155,7 @@ date = date(:); ## Move day 0 from midnight -0001-12-31 to midnight 0000-3-1 - z = floor (date) - 60; + z = double (floor (date) - 60); ## Calculate number of centuries; K1 = 0.25 is to avoid rounding problems. a = floor ((z - 0.25) / 36524.25); ## Days within century; K2 = 0.25 is to avoid rounding problems. @@ -332,6 +332,8 @@ %!test %! t = linspace (-2e5, 2e5, 10993); %! assert (all (abs (datenum (datevec (t)) - t') < 1e-5)); +%!assert (double (datevec (int64 (datenum ([2014 6 1])))), datevec (datenum ([2014 6 1]))) +%!assert (double (datevec (int64 (datenum ([2014 6 18])))), datevec (datenum ([2014 6 18]))) %% Test input validation %!error datevec ()