MATLAB: How to find and remove the rows starting with different word

cell arrayMATLAB

Hi All;
I have a 40000 row document. The words 1 to 485 start with the letter "a". The words 486 to 1158 start with the letter "b". It starts with the letter "c" between 1158 and 4000… There are some erroneous places among these word groups. For example, there are words starting with another letter such as "b, c, d, v …" in groups of words that should start with the letter "a" between 1 and 485. How can I find and remove the rows of these?
Thank you for your help.

Best Answer

I hope this helps.
Cnew = cellfun(@char,Cnew,'uni',0); % convert the cell array contents to string
index = cellfun('isempty',(regexpi(Cnew,'^c.*'))); % find index of line not starting with C
Cnew(index) = []; % remove line not starting with C