How to separate numbers and text from a string
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Venkatapathi
el 28 de En. de 2014
Comentada: Nader Virk
el 25 de Feb. de 2022
Hello,
i have string variable s = 'x 5.67 y 7.789';
i would like to read only numbers from the string.
requesting you to help me, how to separate numbers and text from the string.
Thanks & Regards Venkatapathi.P
0 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 28 de En. de 2014
Editada: Azzi Abdelmalek
el 28 de En. de 2014
s = 'x 5.67 y 7.789'
out=str2double(regexp(s,'[\d.]+','match'))
4 comentarios
Bhupinder Saini
el 5 de Sept. de 2018
How do you alter this to return the characters only in the string?
i.e. x.h y g j
Nader Virk
el 25 de Feb. de 2022
For string s, I appreciate if someone could help how to get only the chracters? Thanks!
Más respuestas (0)
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!