MATLAB: Fopen won’t open filename created with fullfile

batch filesfopenfullfileMATLAB

When trying to open a series of files within a loop:
[filelist, pathname, filterindex] = uigetfile({'*.ProcSpec';'*,*'},'File Selector','Pick a file','MultiSelect', 'on');
filecount = 1;
while filecount < length(filelist)
fid = fopen(fullfile(pathname, filelist(filecount)));
I get the following error.
Error using fopen
First input must be a file name of type char, or a file identifier of type double.
Error in bulk_import (line 8)
fid = fopen(fullfile(pathname, filelist(filecount)));
I based this on some very similar example code, and I'm not sure why the fopen function is having issues in this case. Thank you!

Best Answer

filelist{filecount}
not round brackets.