Text analytics toobox. find specific text in strings in (n x 3) variables
2 ビュー (過去 30 日間)
古いコメントを表示
Ernesto Marco Martinelli
2021 年 5 月 1 日
コメント済み: Ernesto Marco Martinelli
2021 年 5 月 7 日
I am finding the specific word 'group 1' into the multiple strings LIST represented by multiple cells (n,1:3) where the words ' group 1' is contained in the second column: (n,2).
I am using the following line code: Index = find(contains(LIST{1}(:,2),'group1');
It works to identify all the rows tnumbers hat contain the word 'group 1', but unfortunately these numbers includes also the lnes that contains 'group 10' , 'group 11', 'group 12' etc.
There is a way to selectively extracs the specific lines for 'group 1' excluding the others with the above different letters?
Thank You very much for an help.
Marco
0 件のコメント
採用された回答
Sindhu Karri
2021 年 5 月 6 日
Hii,
You can use matches function instead of contains function to get the correct index.I have attached a sample code
C = {'rand10','rand11','text','text10','rand1'};
Index = find(matches(C,'rand1'))
Hope this helps
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!