Mercurial > hg > octave-nkf
diff src/graphics.cc @ 11456:fbdb95640852
get: return empty matrix if no values are found
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 07 Jan 2011 12:52:46 -0500 |
parents | 2be9e22796d2 |
children | d86389a6dc3f |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -6150,15 +6150,21 @@ { octave_idx_type len = vals.numel (); - if (len > 1) - retval = vals; + if (len == 0) + retval = Matrix (); else if (len == 1) retval = vals(0); + else + retval = vals; } return retval; } +/* +%!assert (get (findobj (0, 'Tag', 'nonexistenttag'), 'nonexistentproperty'), []) +*/ + // Return all properties from the graphics handle @var{h}. // If @var{h} is a vector, return a cell array including the // property values or lists respectively.