フィルターのクリア

how to export files to specific folders with GUI?

4 ビュー (過去 30 日間)
Rohan Maharjajn
Rohan Maharjajn 2017 年 8 月 22 日
コメント済み: Adam 2017 年 8 月 23 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2017 年 8 月 22 日
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 件のコメント
Rohan Maharjajn
Rohan Maharjajn 2017 年 8 月 23 日
@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"
Adam
Adam 2017 年 8 月 23 日

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by