Convert cell of strings to numbers
古いコメントを表示
Hallo, On the one hand I have a cell of strings (with around 400 elements) and on the other hand in a loop I have another element (different each time) so I have to find the position of that element at the big array each time. Which is really slow.... so my intention is to convert the cell to numbers (the other string as well) and then just find in the array of number one number.
Is that possible?
Thanks in advance!
2 件のコメント
Azzi Abdelmalek
2015 年 2 月 25 日
編集済み: Azzi Abdelmalek
2015 年 2 月 25 日
Can you post a short example? and post the code you are using
採用された回答
その他の回答 (2 件)
Azzi Abdelmalek
2015 年 2 月 25 日
str = {'a' 'b' 'c' 'd' 'e' 'f'}
w='c'
out=find(ismember(str,w))
Sara
2015 年 2 月 25 日
0 投票
If your cell array includes only numbers, you can use cell2mat
カテゴリ
ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!