convert String (cell) table
1 回表示 (過去 30 日間)
古いコメントを表示
Hi guys,
I try to convert a sting cell array in an integer array. My string array contains basically integers but some values have an additional A/B/C sufix (e.g. 12A or 14C). So I want to replace the A/B/C with .1/.2/.3 to have only double values. I would be grateful for any help!?!
I thought using ismember to find the A/B/C and then I need some kind of string parser!
0 件のコメント
採用された回答
Fangjun Jiang
2011 年 7 月 21 日
Would this work for you?
Str={'12','12A','12B','12C','13'};
Str=strrep(Str,'A','.1');
Str=strrep(Str,'B','.2');
Str=strrep(Str,'C','.3');
Date=str2double(Str)
その他の回答 (0 件)
参考
カテゴリ
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!