Extract single-digit and double-digit numbers at the same time from a cell array with "regexp"
Show older comments
Hi, I am trying to extract the numbers from the following cell array:
a={'1','3','6-10','11-20'};
If I use regexp, the number 10, 11 and 20 are also split:
b=regexp(a,'[0-9]','match');
b{:}
I would like to have the number 10, 11 and 20 unsplitted. How to do it, maybe still with regexp?
2 Comments
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!