Filter löschen
Filter löschen

how to export files to specific folders with GUI?

2 Ansichten (letzte 30 Tage)
Rohan Maharjajn
Rohan Maharjajn am 22 Aug. 2017
Kommentiert: Adam am 23 Aug. 2017
i have a GUI which calculates certain data and exports the data to an Excel file and '.jpeg' file of some plots. Now, what I want to do is to export the result to a specific folder like, "Problem 1" when the program is run for the first time ., "Problem 2" for second time and so on.. so i need a counter for the program and also export the results to specific problems.

Antworten (1)

Image Analyst
Image Analyst am 22 Aug. 2017
Use the fullfile function to build a complete filename (folder + base file name). Here's an example:
% 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)
  2 Kommentare
Rohan Maharjajn
Rohan Maharjajn am 23 Aug. 2017
@Image Analyst what i want to do it to save the generated '.jpg' sand '.xlsx' files to a new folder.The folder must be created automatically when the user executes the code . eg: "Problem 1", where '1' is the value of the counter: so for nth execution, the folder name must be, "Problem n"

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Migrate GUIDE Apps 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!

Translated by