MATLAB: How to extract number from cell array

cell arrayextract number

I have a cell array that contains only the following text: 'Interval: 0.02 sec'. How can I extract the number 0.02 from the cell, to be used in calculations?

Best Answer

cellfun(@(x) sscanf(x,'Interval: %f'),c,'un',0) % assuming follows the same pattern , turn 0 to 1 if it’s a scalar output.
Related Question