str2double breaks when you pass in a vector?
古いコメントを表示
this works:
double = str2double('06012015');
but this doesn't:
doubles = str2double(['06012015' '06022015']);
whos doubles gives me this:
-------
6.0120e+14
Name Size Bytes Class Attributes
doubles 1x1 8 double
-------
1 件のコメント
Jan
2016 年 12 月 28 日
['06012015' '06022015'] is the same as '0601201506022015' .
回答 (2 件)
KSSV
2016 年 12 月 28 日
str1 = str2double([{'106012015'} {'06022015'}])
str2 = str2num(['06012015' ;'06022015'])
2 件のコメント
59morgan
2016 年 12 月 28 日
Walter Roberson
2016 年 12 月 28 日
str2double( cellstr(date_strings) )
Sean de Wolski
2016 年 12 月 28 日
In >=R2016b, you can just call double on the string directly:
double(string({'06012015' '06022015'}))
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!