Undefined function 'contains' for input arguments of type 'char'

19 次查看(过去 30 天)
Hi,
I am trying to use contains to check if string A has string B in it. Say, A = 'XYZXYZ', B = 'XY', I am using: tf = contains(A, B); But I keep getting error "Undefined function 'contains' for input arguments of type 'char'" Why?
Thanks in advance for any help. Jennifer

采纳的回答

the cyclist
the cyclist 2017-1-23
编辑:the cyclist 2017-1-23
Are you using an older version of MATLAB? According to the documentation for contains, this function was introduced in version R2016b.
You might be able to use strfind instead.

更多回答(1 个)

Geoff Hayes
Geoff Hayes 2017-1-23
Jennifer - which version of MATLAB are you using? According to contains, this function was introduced in R2016b.

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by