Convert string to double precision value
converts the text in string X
= str2double(str
)str
to a double-precision
value.
str
contains text that represents a number. Text that represents
a number can contain:
Digits
A decimal point
A leading +
or -
sign
An e
preceding a power of 10 scale factor
If str2double
cannot convert text to a number, then it returns
a NaN
value.
Note
The operator str2double
is supported only in Stateflow® charts that use C as the action language.
Enclose literal strings with single or double quotes.