Mercurial > hg > octave-nkf
changeset 5444:781c9e7dbb73
[project @ 2005-09-08 02:55:21 by jwe]
author | jwe |
---|---|
date | Thu, 08 Sep 2005 02:56:01 +0000 |
parents | ec8c33dcd1bf |
children | 1d7ef19081e8 |
files | src/ChangeLog src/dirfns.cc src/ov-struct.cc |
diffstat | 3 files changed, 24 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2005-09-07 Bill Denney <denney@seas.upenn.edu> + + * dirfns.cc (Fglob): Doc fix. + +2005-09-07 John W. Eaton <jwe@octave.org> + + * ov-struct.cc (Fstruct): Allow struct (zeros (0, N)) to create a + 0xN struct array. + 2005-09-04 David Bateman <dbateman@free.fr> * DLD-FUNCTIONS/colamd.c (COLAMD_NAME, SYMAMD_NAME): New macros
--- a/src/dirfns.cc +++ b/src/dirfns.cc @@ -551,10 +551,11 @@ DEFUN (glob, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} glob (@var{pattern})\n\ -Given an array of strings in @var{pattern}, return a cell array of file\n\ -names that match any of them, or an empty cell array if no patterns match.\n\ -Tilde expansion is performed on each of the patterns before looking for\n\ -matching file names. For example,\n\ +Given an array of strings (as a char array or a cell array) in\n\ +@var{pattern}, return a cell array of file names that match any of\n\ +them, or an empty cell array if no patterns match. Tilde expansion\n\ +is performed on each of the patterns before looking for matching file\n\ +names. For example,\n\ \n\ @example\n\ @group\n\ @@ -562,7 +563,8 @@ @result{} \"/vmlinuz\"\n\ @end group\n\ @end example\n\ -@end deftypefn") +@end deftypefn\n\ +@seealso{ls,dir}") { octave_value retval;
--- a/src/ov-struct.cc +++ b/src/ov-struct.cc @@ -519,11 +519,16 @@ int nargin = args.length (); - // struct([]) returns an empty struct. - // XXX FIXME XXX should struct() also create an empty struct? + // struct ([]) returns an empty struct. + + // struct (empty_matrix) returns an empty struct with the same + // dimensions as the empty matrix. + + // Note that struct () creates a 1x1 struct with no fields for + // compatibility with Matlab. if (nargin == 1 && args(0).is_empty () && args(0).is_real_matrix ()) - return octave_value (Octave_map ()); + return octave_value (Octave_map (args(0).dims ())); // Check for "field", VALUE pairs.