determining indices of double type cells in a cell array of char and double type cells
10 ビュー (過去 30 日間)
古いコメントを表示
hie. i have a cell array that contains several cells of of type char which are separated by cells of type double. actually there are several 'fasta' strings that belong to different folding classes. so the cells containing the fasta strings are separated by the double type cells that contain the number of the folding class. all i want is to determine the indices of these double type cells in the cell array. i feel it is really easy.i dunno why i can't find the solution.can anybody help?
0 件のコメント
採用された回答
jgg
2016 年 1 月 22 日
編集済み: jgg
2016 年 1 月 22 日
See if this solves your problem
c = {'cat',1,'bird',22,'elephant',3}; %an example of data in the format you have
ind = find(cellfun(@isnumeric,c) == 1);
This will return the indices of the numeric data in your cell array. If you want an indicator instead for whether an element is numeric, use just cellfun(@isnumeric,c) instead.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Identification についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!