How to retrieve a word from a filename
Mostrar comentarios más antiguos
name:"rgb_watermark_lena.jpg"
I want to retrieve only "lena" word from file
It should be "lena.jpg"
Can any one sort out this problem
Respuesta aceptada
Más respuestas (1)
Neil Caithness
el 6 de Mayo de 2012
It rather depends on how general you want it. Here's another example that may help you decide.
filename = 'rgb_watermark_lena.jpg';
[~, name, ext] = fileparts(filename);
nameparts = regexp(name, '_', 'split');
newfilename = fullfile([nameparts{end} ext])
Categorías
Más información sobre Denoising and Compression 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!