How do I make a file name with combination of two strings ?
94 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi All
How do I make a file name with combination of two strings ? most of the examples I have seen are combination of a file and a number
0 comentarios
Respuesta aceptada
Jan
el 10 de Feb. de 2018
folder = 'D:\Temp';
str1 = 'aaa'
str2 = 'bbb'
% Alternatives:
name = [str1, str2]
name = strcat(str1, str2)
name = cat(2, str1, str2)
name = horzcat(str1, str2)
name = sprintf('%s%s', str1, str2) % See Stephen's solution
% Creates: C\Temp\aaa\bbb
fullname = fullfile(folder, str1, str2)
0 comentarios
Ver también
Categorías
Más información sobre Characters and Strings en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!