MATLAB: Filter a cell array with words

filter words cell array

Hi,
assume you have the cell array{1,1} with a text called "XXXX-adsaads". I want the the portion -adsaads to be removed so that I only get XXXX. How can I do this?

Best Answer

trimedcell = regexprep(YourCellArray, '-.*', '', 'once');
Related Question