str2double
Converts a string to double.
📝Syntax
res = str2double(str)
📥Input Arguments
Parameter Description
str a cell of strings, string array or a string.
📤Output Arguments
Parameter Description
res a double
📄Description

str2double converts any complex number as a whole into a complex numeric field, converting the real and imaginary parts to the specified numeric type.

If str2double cannot convert string to a number, then it returns a Not An Number value.

💡Examples
R = str2double('2.6 + 3j')
R = str2double('+NaNi')
R = str2double({'2.71' '3.1415'})
R = str2double(["2.71" "3.1415"])
🔗See Also
double
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub