MATLAB: Extracting individual file data from uigetfile multiselect

imshowmultiselectuigetfile

I want to use the multiselect feature of uigetfile, and I have done this successfully, returning the pathname and filenames of all of the files that I want. The files Im selecting are images and I want to show the first image in the series in a figure, but I am unable to do this, an error message pops up saying:
"Expected input number 1, I, to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64, logical
Instead its type was cell."
How can I convert the image location from a "cell" to something I can use? My current code:
"[filename pathname] = uigetfile('*.*', 'Pick Images', 'Multiselect', 'on');
image_matrix = fullfile(pathname, filename(1))
imshow(image_matrix)"

Best Answer

To access the data in a cell array you need to use curly braces, not parentheses:
filename{1}
because this
filename(1)
will simply return the first cell, and not the data inside the cell.