x = str2num('str')
x = str2num('str')
converts the string str
, which is an ASCII character representation of a numeric value, to MATLAB's numeric representation. The string can contain digits, a decimal point, a leading + or - sign, an e
preceding a power of 10 scale factor, and/or an i
for a complex unit.
str2num('3.14159e0')
is approximately pi .
x = str2num(s)
is a single line:
eval(['x = ' s ';']);
hex2num
,num2str
,sscanf
(c) Copyright 1994 by The MathWorks, Inc.