Filter löschen
Filter löschen

how remove words from a cell array

2 Ansichten (letzte 30 Tage)
elisa ewin
elisa ewin am 2 Aug. 2017
Bearbeitet: Stephen23 am 2 Aug. 2017
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

Akzeptierte Antwort

Stephen23
Stephen23 am 2 Aug. 2017
Bearbeitet: Stephen23 am 2 Aug. 2017
>> 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

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by