Mercurial > hg > octave-nkf
diff scripts/io/strread.m @ 12873:e8c8e118a1e6
Small touchups to textscan and strread revamp
* textscan.m: Stop passing headerlines option to strread.
* strread.m: Use str2double, not str2num, for better performance.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 22 Jul 2011 16:47:40 -0700 |
parents | fe6e2afcd9ee |
children | ddea3962b024 |
line wrap: on
line diff
--- a/scripts/io/strread.m +++ b/scripts/io/strread.m @@ -529,7 +529,7 @@ k++; case {"%0", "%1", "%2", "%3", "%4", "%5", "%6", "%7", "%8", "%9"} nfmt = strsplit (fmt_words{m}(2:end-1), '.'); - swidth = str2num (nfmt{1}); + swidth = str2double (nfmt{1}); switch fmt_words{m}(end) case {"d", "u", "f", "n%"} n = cellfun ("isempty", data); @@ -541,7 +541,7 @@ data(end+1:num_lines) = numeric_fill_value; endif if (numel (nfmt) > 1) - sprec = str2num (nfmt{2}); + sprec = str2double (nfmt{2}); data = 10^-sprec * round (10^sprec * data); endif varargout{k} = data.';