How to extract only floating numbers from a string
Mostrar comentarios más antiguos
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 comentario
Jan
el 20 de Jun. de 2018
What's about '1e-5', '1D+004', '.1'?
Respuesta aceptada
Más respuestas (1)
Riadh Essaadali
el 21 de Mayo de 2023
0 votos
C = regexp(S,'[-+]?\d+\.?\d*','match');
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!