-3
>> [NUM,TXT,RAW]=xlsread('C:\Users\Lincoln Wachn\Google Drive\Summer time\Book1')
??? Error using ==> xlsread at 219
XLSREAD unable to open file C:\Users\Lincoln Wachn\Google Drive\Summer
time\Book1.
File C:\Users\Lincoln Wachn\Google Drive\Summer time\Book1.xls not found.

This is the error that I have received when I try to read a simple Excel file into MATLAB.


This is a snapshot of the spreadsheet I would like to load in.

Book1 image

Could guide me the basic know-how to extract these data? I have looked through the other questions pertaining to reading Excel files into MATLAB, but I am still very confused. I ultimately wish to extract the file below for my project using the same method.

Image 2 for my project

The second image shows the data I have to extract which I could not do. Its file type seems to be different, it is comma separated values file which is not xls. Hence, I am also confuse about whether different file type prevents extraction of data.

rayryeng
  • 102,964
  • 22
  • 184
  • 193

1 Answers1

0

The error is pretty obvious. It says File not found. Make sure the file that you want to load in is placed in the same directory as the one referenced in xlsread. Also, to read in comma-separated value files, use the csvread function.

rayryeng
  • 102,964
  • 22
  • 184
  • 193
  • Hi rayryeng, may I know the difference between xls and csv type? Any source that I can read up on. Thanks you! – user3693727 Jun 01 '14 at 13:47
  • `xls` is a proprietary Microsoft format so you would need software like Excel (or MATLAB and R) to read it. `csv` can be made completely on your own. Each column is separated by a **comma**, and each row is separated by a carriage return. Very easy format. http://en.wikipedia.org/wiki/Comma-separated_values – rayryeng Jun 01 '14 at 16:19