UIgetfile Error on Matlab Online

3 visualizaciones (últimos 30 días)
Michael Chang
Michael Chang el 16 de Mzo. de 2020
Comentada: Cris LaPierre el 17 de Ag. de 2021
When I run this line, I'm receiving this error. Not too sure how to interpret it. Thanks in advance for the help! I'm using Matlab Online.
[f_name p_name] = uigetfile('*.mat','Select the input data file(s)','MultiSelect', 'on');
Index exceeds the number of array elements (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)
updateFromDialog(obj,updateDataObject(obj));
  2 comentarios
Geoff Hayes
Geoff Hayes el 16 de Mzo. de 2020
Michael - at what point do you see this error? After you have chosen a file? Have you chosen more than one file? It sounds like filepaths is empty so please describe what you have selected.
Michael Chang
Michael Chang el 16 de Mzo. de 2020
I get this error after I've chosen a file (same result for one or multiple files).

Iniciar sesión para comentar.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 16 de Mzo. de 2020
Editada: Cris LaPierre el 16 de Mzo. de 2020
It appears the 'Multiselect' flag is what is causing the error. Remove that, and it should work.
[f_name p_name] = uigetfile('*.mat','Select the input data file(s)');
  2 comentarios
Ahmad Gad
Ahmad Gad el 16 de Ag. de 2021
What if I still need to select multiple files?
Cris LaPierre
Cris LaPierre el 17 de Ag. de 2021
If you are using MATLAB Online, you would need to use multiple calls to uigetfile. Multiselect is not currently supported in MATLAB Online.

Iniciar sesión para comentar.

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by