Mercurial > octave-nkf
diff scripts/general/interp1.m @ 17088:c8586e6fc60d
interp1.m: Fix interpolation on ND-arrays (bug #35860)
* interp1.m: Fix implicit indexing of the rows of ND-arrays when X vector
is not specified.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Fri, 26 Jul 2013 00:25:24 -0400 |
parents | bb3a1ec7cc4b |
children | c3c1ebfaa7dc |
line wrap: on
line diff
--- a/scripts/general/interp1.m Fri Jul 26 00:09:41 2013 -0400 +++ b/scripts/general/interp1.m Fri Jul 26 00:25:24 2013 -0400 @@ -149,7 +149,11 @@ if (isempty (xi) && firstnumeric && ! ispp) xi = y; y = x; - x = 1:numel (y); + if (isvector (y)) + x = 1:numel (y); + else + x = 1:rows (y); + endif endif ## reshape matrices for convenience