MATLAB: Saving problems, desired name save I'm trying to save anything under the name I want, for example: savename= input('Save as:','s'); save(savename); but this doesnt seem to be working. Please help, thank you 🙂 Best Answer Try this:% 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;endfullFileName = fullfile(folder, baseFileName)% Now save whatever variables you want into a mat filesave(fullFileName, 'yourVariable1', 'yourVariable2'); Related SolutionsMATLAB: Save output for specific folder Suhas - uigetdir returns a directory only so you need to specify a file name too. Perhaps something likefolderToSaveFileTo = uigetdir ("F: \");filename = "someName.mat";save (fullfile(folderToSaveFileTo, filename), "d"); MATLAB: How can i change the path when saving the file Replacewavwrite(y,filename)bywavwrite( y, fullfile( pathname, filename) ) Related QuestionProblem with working the browsing image in gui
Best Answer