remove whitespace from cell array
Show older comments
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
Accepted Answer
More Answers (1)
Lev Vitkin
on 17 Jan 2024
0 votes
flight_no = cellfun(@(s) s(~isspace(s)), flight_no, 'UniformOutput', false)
Categories
Find more on Cell Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!