Matlab skips uigetfile upon run, does function upon run section

I call uigetfile from within a script to select a filename to load datafiles.
All of a sudden, Matlab (2013a) appears to skip the line containing uigetfile when I run ('run' command) the script. Strangely enough, when I run only the code section ('run section' command) in which the function containing uigetfile is contained, it does function.
Main script:
%%Load the data to analyse
[data,nFiles,directory] = loadtgadata(directory); % Load the data from the textfiles
Relevant lines in the function:
function [data,nFiles,directory] = loadtgadata(directory)
[files,directory] = uigetfile('*.*','Load TGA data',directory,'MultiSelect','on');
Matlab gives an error upon reaching the next part of the code, which is only logical, since the variable files does not exist.

1 comentario

More significant is the structure of the file containing the script, its name and how you try to call it.
From the command line, try
which yourscriptname
and report on the result. NB that scripts must have m-file names that are legal variable names to Matlab, no spaces and case is significant and stored in a path in the MATLABPATH variable.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 29 de Oct. de 2013

Comentada:

dpb
el 29 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by