How can i create dynamic file name?
Mostrar comentarios más antiguos
zero=0;
name=input('file name and extension: (ex: 1234.txt): ','s');
dart=importdata(name);
A=(dart.data);
new_name= sprintf('dart_%d.txt',zero);
dlmwrite(new_name,A,'delimiter',' ','newline', 'pc')
How can i generate file names like "dart_[filename]_0" ? i want to add _0 to my file names
Respuestas (1)
name = input('file name and extension: (ex: 1234.txt): ','s');
[pth,name,ext] = fileparts(name);
new = sprintf('dart_%s_%d%s',name,0,ext)
and if you want to see a working example:
>> name = input('file name and extension: (ex: 1234.txt): ','s');
file name and extension: (ex: 1234.txt): test.jpeg
>> [pth,name,ext] = fileparts(name);
>> new = sprintf('dart_%s_%d%s',name,0,ext)
new =
dart_test_0.jpeg
Categorías
Más información sobre Convert Image Type 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!