How to extract only floating numbers from a string
Show older comments
Here is my string "21.5VgDC_0.05000V_VgAC_50M-150M30ms47GV1" How can I extract only the numbers 21.5, 0.05000, 50, 150 30 and 47 from the string. Thanks in advance
1 Comment
Jan
on 20 Jun 2018
What's about '1e-5', '1D+004', '.1'?
Accepted Answer
More Answers (1)
Riadh Essaadali
on 21 May 2023
0 votes
C = regexp(S,'[-+]?\d+\.?\d*','match');
Categories
Find more on Characters and Strings 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!