How to read file from excel in MATLAB

1 view (last 30 days)
Saher Ahmed
Saher Ahmed on 24 Nov 2015
Edited: Adam on 24 Nov 2015
Hi, I'm trying to read a file from excel in matlab. However whenever I use xlsread, it gives me this message: LS= xlsread('Lake Superior Temperatures.xlsx') Error using xlsread (line 132) XLSREAD unable to open file 'Lake Superior Temperature.xlsx'. File '/Users/sa/Documents/MATLAB/Lake Superior Temperature.xlsx' not found.
The file is in documents but for some reason it cant find it? Where should I save the excel document so that matlab can read it properly? I'm using a MacBook Pro and I'm sort of new at it so any help would be very much appreciated!

Answers (1)

Adam
Adam on 24 Nov 2015
Edited: Adam on 24 Nov 2015
You need to give a full path including the drive.
e.g. on my machine that would be:
'C:/users/...'
It cannot find the path starting with just:
'/users/...'
This can be verified by the simple test:
>> dir( '/Users/' )
'/Users/' not found.
>> dir( 'C:/Users/' )
. All Users Default User Public desktop.ini
.. Default etc etc

Community Treasure Hunt

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

Start Hunting!