Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
11455:2be9e22796d2 | 11456:fbdb95640852 |
---|---|
6148 | 6148 |
6149 if (! error_state) | 6149 if (! error_state) |
6150 { | 6150 { |
6151 octave_idx_type len = vals.numel (); | 6151 octave_idx_type len = vals.numel (); |
6152 | 6152 |
6153 if (len > 1) | 6153 if (len == 0) |
6154 retval = vals; | 6154 retval = Matrix (); |
6155 else if (len == 1) | 6155 else if (len == 1) |
6156 retval = vals(0); | 6156 retval = vals(0); |
6157 else | |
6158 retval = vals; | |
6157 } | 6159 } |
6158 | 6160 |
6159 return retval; | 6161 return retval; |
6160 } | 6162 } |
6163 | |
6164 /* | |
6165 %!assert (get (findobj (0, 'Tag', 'nonexistenttag'), 'nonexistentproperty'), []) | |
6166 */ | |
6161 | 6167 |
6162 // Return all properties from the graphics handle @var{h}. | 6168 // Return all properties from the graphics handle @var{h}. |
6163 // If @var{h} is a vector, return a cell array including the | 6169 // If @var{h} is a vector, return a cell array including the |
6164 // property values or lists respectively. | 6170 // property values or lists respectively. |
6165 | 6171 |