Uigetfile multiple selection in MATLAB app designer

3 views (last 30 days)
I'd like to have a button on matlab app designer that when pushed, enables the user to select more files.
I tried first with one single file with this code and everything works well:
[filename,path] = uigetfile('*.txt');
If then, I try to select more files with the following code:
[filename,path] = uigetfile('*.txt','Select the files','MultiSelect', 'on');
I get this error:
Index exceeds the number of array elements. Index must not exceed 0.
Error in matlab.ui.internal.dialog.FileChooser/updateFromDialog (line 215)
obj.PathName = filepaths{1};
Error in matlab.ui.internal.dialog.FileChooser/prepareDialog/localupdate (line 95)
Can anyone help me with this?
Claudia Scarpellini
Claudia Scarpellini on 16 Nov 2021
Thank you for your answer. I'm not modyfying any toolbox function.
Could it have something to do with the fact that I'm using MATLAB online?
I modified my code to:
[filenameS, pathS] = uigetfile('*.txt','Select the files','MultiSelect', 'on');
But I still get the same error.

Sign in to comment.

Accepted Answer

Cris LaPierre
Cris LaPierre on 16 Nov 2021
"Could it have something to do with the fact that I'm using MATLAB online?"
Yes. Multiselect with uigetfile is not currently possible in MATLAB Online.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!