How to insert a string into a sprint?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
JOJO
am 22 Dez. 2013
Kommentiert: Image Analyst
am 23 Dez. 2013
I want the input stored into name be displayed in the %s. How can I do it? it is possible?
name = input ('Enter the name of the voice command');
file = sprintf('%s.wav','name'); %name the sound file to be created
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 22 Dez. 2013
name = input ('Enter the name of the voice command','s');
file = sprintf('%s.wav',name);
0 Kommentare
Weitere Antworten (1)
Image Analyst
am 22 Dez. 2013
Try this more user friendly and robust way to "get the name of the sound file to be created":
% Ask user for the name of the file to be created.
[baseFileName, folder] = uiputfile('*.wav', 'Enter the file name of the voice command to be created')
% Create the full file name with the folder prepended.
% .wav will be automatically appended regardless
% if they did or did not enter an extension.
fullFileName = fullfile(folder, baseFileName)
1 Kommentar
Image Analyst
am 23 Dez. 2013
Siehe auch
Kategorien
Mehr zu Spectral Measurements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!