Problem in displaying a substring
Mostrar comentarios más antiguos
Problem in displaying a substring
Ex: I have this line:-
C:\abc\xyz\myName_1.wav
I want to display only 'myName' from this line
Respuesta aceptada
Más respuestas (1)
Grzegorz Knor
el 30 de Dic. de 2011
doc fileparts
doc strfind
2 comentarios
Grzegorz Knor
el 30 de Dic. de 2011
In your case:
[pathstr, name, ext] = fileparts('C:\abc\xyz\myName_1.wav')
idx = strfind(name,'_')
disp(name(1:idx-1))
Nishat Anjum Shaikh
el 30 de Dic. de 2011
Categorías
Más información sobre Cell Arrays 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!