MATLAB: How to solve “index exceeds matrix dimension” while using imread

dimensionexceedimreadlarge pictureMATLAB

I am trying to program the Wiener Filter. And the sizes of pictures that I am going to read range from 5MB to around 15MB. When I imread the picture, there is error saying "Index exceed the matrix dimension"
Error:
Index exceeds matrix dimensions.
Error in QM (line 3)
im=imread([base,files(1).name]);
Program:
base='Users\aa\Downloads\';
files = dir( fullfile(base,'1.tif') );
im=imread([base,files(1).name]);
I = im2double(im);
imshow(I);
title('Original Image (courtesy of MIT)');
LEN = 21;
THETA = 11;
PSF = fspecial('motion', LEN, THETA);
blurred = imfilter(I, PSF, 'conv', 'circular');
figure, imshow(blurred)
noise_mean = 0;
noise_var = 0.0001;
blurred_noisy = imnoise(blurred, 'gaussian', ...
noise_mean, noise_var);
figure, imshow(blurred_noisy)
title('Simulate Blur and Noise')
estimated_nsr = 0;
wnr2 = deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr2)
title('Restoration of Blurred, Noisy Image Using NSR = 0')
estimated_nsr = noise_var / var(I(:));
wnr3 = deconvwnr(blurred_noisy, PSF, estimated_nsr);
figure, imshow(wnr3)
title('Restoration of Blurred, Noisy Image Using Estimated NSR');

Best Answer

The error is not in imread, the error is on line 3 of your program as the message says. My suspsicion is that files is empty, therefore the 1 index in files(1) indeed exceeds the matrix dimension of files.
I'll note that the path you pass to the dir function is not absolute. It therefore looks for '1.tif' in the 'Users\aa\Downloads' of the current directory whatever that is. Perhaps you're missing a 'C:\' ahead of your path?