Convert cell array to numeric data
6 ビュー (過去 30 日間)
古いコメントを表示
I have a large cell array of strings I am trying to convert to numeric data
> whos tt
Name Size Bytes Class Attributes
tt 8634370x1 6147671440 cell
tt(1)
ans =
{1x5 cell}
tt{1}
ans =
'2017' '058' '19' '24' '01.052261'
I am trying to convert this into a matrix of 8634370x5 using str2num or eval. I am lost in cell array indexing. Any help is greatly appreciated. Thanks.
Jaggu
0 件のコメント
回答 (1 件)
Alexandra Harkai
2017 年 3 月 9 日
cellfun(@str2num, tt)
will do the trick, cellfun applies str2num to every cell.
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!