MATLAB: How to remove the numbers from a cell that contains both numbers and strings

cell arrayloop

I need to remove the numbers from this cell array as well as the + sign and = sign. But I want to keep the species names. So the final cell array will have each of the specie names in it and nothing else. I would like to do it using a loop of some sort. Is this possible? Please help me!
SpeciesName = {
'RH'
'+'
'OH'
'='
'RO2'
'H2O'
'26.3e-12'
'NO'
'NO2'
'RCHO'
'HO2'
'7.7e-12'
'8.1e-12'
'HNO3'
'1.1e-11'
'H2O2'
'O2'
'2.9e-12'
'ROOH'
'5.2e-12'
'hv'
'O3'
'0.015'
'1.9e-14'}

Best Answer

You could use a regular expression. This would work with the example you've provided (assuming hv is to be kept)
tokeep = cellfun(@isempty, regexp(SpeciesName, '^(?:\+|=|[0-9.e+-]+)$'));
SpeciesName = SpeciesName(tokeep)
No loop needed.
Related Question