Problem in displaying a substring
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Grzegorz Knor
am 30 Dez. 2011
doc fileparts
doc strfind
2 Kommentare
Grzegorz Knor
am 30 Dez. 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
am 30 Dez. 2011
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!