str2double

Returns a scalar, complex number or matrix, R, after converting the input s.

Syntax

R = str2double(s)

Inputs

s
Type: string | mat

Outputs

R
If a conversion fails, Nan is returned.
Type: scalar | complex number | matrix

Examples

String to scalar conversion:
R = str2double('2.345e+5')
R = 234500
String to complex conversion:
R = str2double('24 + 7i')
R = [Matrix] 1 x 1
24 + 7i
Matrix of strings to matrix of numbers conversion:
R = str2double(['65', '66'; '88', '92'])
R = [Matrix] 2 x 1
6566
8892