MATLAB: How to extract all numbers from a cell array of strings

cellextractMATLABnumbersstringstrip

I have a cell array of strings. Each string contains at maximum one number and an unknown amount of other characters, for example 'abc13def'. I would like to extract these numbers from the cell array into a numerical array. The elements of the array corresponding to cells which have no number at all should be set to zero.

Best Answer

A function to automatically extract numerical data from a cell array of strings is not available in MATLAB 7.9 (R2009b).
The attached function, strip_cell_to_num, can be used to perform this task using regular expressions.