remove whitespace from cell array
Mostrar comentarios más antiguos
I have a cell array which looks something like this;
'DS 5376'
'FR 8241'
'B 1257'
'BG 09857'
'TR 3017'
I want to remove the central white space (or any white space to that matter) to get the following
'DS5376'
'FR8241'
'B1257'
'BG09857'
'TR3017'
Previous questions and suggested and I have tried using
cell_Array=strrep(cell_Array,' ','')
but to no avail - any ideas as to how I can acheive this?
Many thanks
Respuesta aceptada
Más respuestas (1)
Lev Vitkin
el 17 de En. de 2024
0 votos
flight_no = cellfun(@(s) s(~isspace(s)), flight_no, 'UniformOutput', false)
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!