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

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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

태그

질문:

2013년 10월 29일

댓글:

dpb
2013년 10월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by