I have a cell "A" of strings like {'A0_V2'; 'A0_V1'; 'B2_V4';...}. I want to find which numbers of A contains 'A0'. The answer can be ans = (1, 2).

 Akzeptierte Antwort

Image Analyst
Image Analyst am 30 Jul. 2018

0 Stimmen

Try contains():
A = {'A0_V2'; 'A0_V1'; 'B2_V4'}
rowsWithString = contains(A, 'A0')

Weitere Antworten (0)

Kategorien

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

Produkte

Version

R2018a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by