Filter löschen
Filter löschen

How to save a file by taking the folder path and filename as input from user in MATLAB app designer?

35 Ansichten (letzte 30 Tage)
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;
if isempty(app.FLR)
toBeSaved.para_FLG = app.para_FLG;
if isempty(app.FLFR)
toBeSaved.para_FLR = app.para_FLR;
toBeSaved.para_FLFR = app.para_FLFR;
save(app.filename, '-struct', 'toBeSaved')

Akzeptierte Antwort

Antoni Garcia-Herreros
Antoni Garcia-Herreros am 17 Mär. 2023
Check here
[baseFileName, folder] = uiputfile('Specify a file');
fullFileName = fullfile(folder, baseFileName)

Weitere Antworten (0)


Mehr zu Develop Apps Using App Designer 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