Mercurial > octave
changeset 21755:08e861873118
polyval.m: Return correct empty dimensions for empty input (bug #47934).
* polyval.m: Return input itself when it is empty in order to
have the correct dimensions.
author | Marco Caliari <marco.caliari@univr.it> |
---|---|
date | Mon, 16 May 2016 12:58:35 +0200 |
parents | 34a582f2edd7 |
children | 30d58f5cc7d0 |
files | scripts/polynomial/polyval.m |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/polynomial/polyval.m Wed May 18 13:05:09 2016 +1000 +++ b/scripts/polynomial/polyval.m Mon May 16 12:58:35 2016 +0200 @@ -50,7 +50,7 @@ endif if (isempty (x)) - y = []; + y = x; return; elseif (isempty (p)) y = zeros (size (x)); @@ -154,4 +154,4 @@ %!assert (zeros (1, 10), polyval ([], 1:10)) %!assert ([], polyval (1, [])) %!assert ([], polyval ([], [])) - +%!assert (zeros (0, 1), polyval (1, zeros (0,1)))