Borrar filtros
Borrar filtros

how to export files to specific folders with GUI?

2 visualizaciones (últimos 30 días)
Rohan Maharjajn
Rohan Maharjajn el 22 de Ag. de 2017
Comentada: Adam el 23 de Ag. de 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.

Respuestas (1)

Image Analyst
Image Analyst el 22 de Ag. de 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 comentarios
Rohan Maharjajn
Rohan Maharjajn el 23 de Ag. de 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"

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by