How to save a file by taking the folder path and filename as input from user in MATLAB app designer?
37 ビュー (過去 30 日間)
古いコメントを表示
Amlan basu
2023 年 3 月 17 日
回答済み: Antoni Garcia-Herreros
2023 年 3 月 17 日
I have written the below code to save the file in .mat format and it is working.
However, I want the user to select the specific folder and also the name of file before saving it in every insatnce.
function SaveButtonPushed(app, event)
app.filename = strcat(app.filename,'.mat');
toBeSaved = struct('para_BF_new', app.para_BF_new);
if isempty(app.FLG)
toBeSaved.ROI = app.ROI;
end
if isempty(app.FLR)
toBeSaved.para_FLG = app.para_FLG;
end
if isempty(app.FLFR)
toBeSaved.para_FLR = app.para_FLR;
end
toBeSaved.para_FLFR = app.para_FLFR;
save(app.filename, '-struct', 'toBeSaved')
0 件のコメント
採用された回答
Antoni Garcia-Herreros
2023 年 3 月 17 日
Hello,
Check here
[baseFileName, folder] = uiputfile('Specify a file');
fullFileName = fullfile(folder, baseFileName)
save(fullFileName,'-struct','toBeSaved');
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!