how to write a character from a string?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi I didn't use commands for strings in matlab so i have a word like 'displacement22' and i want to write '22' from this string, so what would i do?
0 comentarios
Respuestas (3)
Image Analyst
el 2 de Feb. de 2013
s = 'displacement22' % Your string.
theNumber = sscanf(s, 'displacement%d') % Extract the number.
0 comentarios
Azzi Abdelmalek
el 2 de Feb. de 2013
Editada: Azzi Abdelmalek
el 2 de Feb. de 2013
s='displacement22' ;
out=s(regexp(s ,'[0-9]'))
%or
out=s(regexp(s ,'\d'))
0 comentarios
Ver también
Categorías
Más información sobre String Parsing 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!