parse and convert literal numbers STRings TO Decimal numbers
[d, tails] = strtod(str) [d, tails] = strtod(str, decimalseparator)
single component, vector, or matrix of strings.
the decimal separator chosen: "." (by default) or ",".
scalar, vector, or matrix of decimal numbers.
a string or matrix of strings: remaining parts of
str after the numerical heads
(if any).
[d, tails] = strtod(str) parses each string of
str and tries to interpret its content as a decimal
number:
str(i), the corresponding decimal number
is returned in d(i). If any, the
trailing part of str(i) is ignored and
returned in tails(i); otherwise,
tails(i) returns "".d(i) returns
%nan, and tails(i) is
the whole str(i).| Version | Description |
| 5.5.0 | Option decimalseparator introduced (SEP 97). |
| 5.4.1 | If str does not contain any numerical value,
d now returns Nan
instead of 0. |