Find cell containing part of a string.

22 次查看(过去 30 天)
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).

采纳的回答

Image Analyst
Image Analyst 2018-7-30
Try contains():
A = {'A0_V2'; 'A0_V1'; 'B2_V4'}
rowsWithString = contains(A, 'A0')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by