Convert cell to matrix
古いコメントを表示
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54
1 件のコメント
Martin Park
2013 年 10 月 6 日
採用された回答
その他の回答 (1 件)
Jan
2013 年 10 月 6 日
Faster than str2double:
C = {'128' '256' '157' '54'};
S = sprintf('%s*', C{:});
D = sscanf(S, '%g*');
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!