Index: str2num.m =================================================================== RCS file: /cvs/octave/scripts/strings/str2num.m,v retrieving revision 1.5 diff -u -r1.5 str2num.m --- str2num.m 8 Sep 2005 01:40:58 -0000 1.5 +++ str2num.m 7 Feb 2006 20:08:12 -0000 @@ -19,13 +19,20 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} str2num (@var{s}) -## Convert the string @var{s} to a number. +## Convert the string or cell @var{s} to a number. ## @end deftypefn ## Author: jwe function m = str2num (s) + startcell = 0; + if (iscellstr (s)) + startsize = size (s); + startcell = 1; + s = strvcat (s(:)); + endif + if (nargin == 1 && ischar (s)) [nr, nc] = size (s); sep = ";"; @@ -39,4 +46,8 @@ usage ("str2num (s)"); endif + if (startcell) + m = reshape (m, startsize); + endif + endfunction