how can i change the path when saving the file ?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 ?
0 commentaires
Réponse acceptée
per isakson
le 18 Déc 2015
Replace
wavwrite(y,filename)
by
wavwrite( y, fullfile( pathname, filename) )
Plus de réponses (1)
Image Analyst
le 18 Déc 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)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!