# HG changeset patch # User Marco Caliari # Date 1463396315 -7200 # Node ID 08e86187311880d7b86f95f0c9834a0c839bf58b # Parent 34a582f2edd7352848213479829cf8cf65a7149e 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. diff -r 34a582f2edd7 -r 08e861873118 scripts/polynomial/polyval.m --- 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)))