MATLAB: Trouble importing data from excel file using xlsread

importing excel dataxlsread

I am having trouble importing data from excel file using xlsread. I attempt as follows:
ndata = xlsread('C:\Documents\oput021m.xlsx', 'F2:F3');
And get the following error:
??? Error using ==> xlsread at 219 XLSREAD unable to open file C:\Documents\oput021m.xlsx. File C:\Documents\oput021m.xlsx not found.
I have even tried opening a file with the .xls extension and continue to get the same error. The file is in the location that is specified, so I am not sure what is going wrong. Could someone please help me out? Thanks.

Best Answer

What do you get when you type
exist('C:\Documents\oput021m.xlsx', 'file')
Does it return 2? If 0, then you mistyped the filename. Make sure you have the correct extension. For Excel files, it could also be .xlsm, .xls, .xlsb.