MATLAB Function Reference | ![]() ![]() |
Syntax
x = str2num('str
')
Description
x = str2num('
converts the string str
')
str
, which is an ASCII character representation of a numeric value, to MATLAB's numeric representation. The string can contain:
e
preceding a power of 10 scale factori
indicating a complex or imaginary number.The str2num
function can also convert string matrices.
Examples
str2num('3.14159e0')
is approximately .
str2num(['1 2';'3 4']) ans = 1 2 3 4
See Also
num2str
, hex2num
, sscanf
, sparse
, special characters
![]() | str2mat | strcat | ![]() |