how can i change the path when saving the file ?
Mostra commenti meno recenti
when i am saving the file , only i can change the name of it but the path stay in file(.m)path. i want to save the file in a path different from the (.m)file how can i do this ? look at this code :
[filename,pathname] = uiputfile({'*.wav', '*.wav'}, 'Save current file as');
wavwrite(y,filename)
it saves the file in the same path of (.m)file , i want to save it in different path ?
Risposta accettata
Più risposte (1)
Image Analyst
il 18 Dic 2015
Here's my snippet that I always give people. It also handles if people click Cancel. Feel free to adapt it.
% Get the name of the file that the user wants to save.
% Note, if you're saving an image you can use imsave() instead of uiputfile().
startingFolder = userpath % Or "pwd" or wherever you want.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uiputfile(defaultFileName, 'Specify a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
1 Commento
Eng Abeer
il 18 Dic 2015
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!