Deleting sepecific character from cell array
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shilo
am 15 Jan. 2013
Kommentiert: Muhammad Usman Saleem
am 5 Nov. 2017
Hi Helpers,
I have a cell array in which some cell has " that I would like to delete such as, '"22000' or '"contig_2012'. (I want it as '22000' or 'contig_2012')
Will be great if you could help me to delete all of them from the cell.
Thanks, Shilo
0 Kommentare
Akzeptierte Antwort
Daniel Shub
am 16 Jan. 2013
This sounds like a job for a regular expression (albeit a simple one)
x = {'"22000'; '"contig_2012'; 'abc'};
regexprep(x, '"', '')
0 Kommentare
Weitere Antworten (1)
Azzi Abdelmalek
am 15 Jan. 2013
Bearbeitet: Azzi Abdelmalek
am 15 Jan. 2013
% in this example we rmove '00' and '123'
A={'123' '1234' '12345' '11' '00'};
idx=cellfun(@(x) isequal(x,'00') | isequal(x,'123'),A);
A(idx)=[]
3 Kommentare
Muhammad Usman Saleem
am 5 Nov. 2017
This answer is for cell array of {1,5} what about array of {31,6} ?
Siehe auch
Kategorien
Mehr zu Logical 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!