| MATLAB Function Reference | ![]() |
Syntax
x = str2double('str')
X = str2double(C)
Description
X = str2double(' 將以ASCII字元所表示的數值 str')
str轉換成雙倍浮點數。 str
可以包括數字、逗點(每四位一個逗點)、小數點、正負號、e(用來表示10的幾次方)和 i (用來表示複數)。
若 str 中的資料不合法, str2double
會回傳 NaN。
X = str2double(C)
將字串 C 中的細胞陣列(cell array)轉換成雙倍浮點數。矩陣 X會和 C
一樣大小相同。
Examples
str2double('123.45e7')
str2double('123 + 45i')
str2double('3.14159')
str2double('2.7i - 3.14')
str2double({'2.71' '3.1415'})
str2double('1,200.34')
See Also
char, hex2num, num2str, str2num
| stopasync | str2func | ![]() |