How to find two continuous words appear in the sentence

sir, Input cell arry
A= {' book is good','camera is working good', 'the picture quality is good'}
Query B={'is good'}
how to find index of the query string is appeared in the sentence.
my output is = 1,3
thanks.

 Akzeptierte Antwort

Stephen23
Stephen23 am 22 Dez. 2014
Bearbeitet: Stephen23 am 22 Dez. 2014
Use strfind .
For example, like this:
find(~cellfun('isempty',strfind(A,'is good')))

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 22 Dez. 2014
idx=find(~cellfun(@isempty,regexp(A,'is good','match')))

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 22 Dez. 2014

Bearbeitet:

am 22 Dez. 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by