gnovice's answer is the simplest solution to this specific problem, but in general if you want to turn a cell array into a numeric one by applying some transformation to each element you can do so using cellfun. For example if you ask MATLAB for length({'apple' 'orange' 'banana'}) you'll get 3, but if you want the length of each string in the array you can do:
>> cellfun(@length, {'apple' 'orange' 'banana'})
ans =
5 6 6
You can use an anonymous function, or a handle to a function that you have defined, as the argument to cellfun, so the transformation can be as complex as you need.
As long as the result from your function is a scalar numeric or logical value, the output from cellfun will be a numeric or logical array; otherwise it will be another cell array (and if it varies in size you will need to use the 'UniformOutput', false argument pair)