how remove words from a cell array

1 次查看(过去 30 天)
Hi, I have a cell array A (attached) and I want to delete the words that have the character \.
Example:
A={'past';'life';'amp';'thinks';'hes';'cat\udd\udc';'https\u';'itsyaaboysb';'somebody'};
I want
A={'past';'life';'amp';'thinks';'hes';'itsyaaboysb';'somebody'};
Can you help me? thanks

采纳的回答

Stephen23
Stephen23 2017-8-2
编辑:Stephen23 2017-8-2
>> A = {'past';'life';'amp';'thinks';'hes';'cat\udd\udc';'https\u';'itsyaaboysb';'somebody'};
>> idx = cellfun('isempty',strfind(A,'\'))
>> B = A(idx)
B =
past
life
amp
thinks
hes
itsyaaboysb
somebody

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by