I wanted to use [~, ~, temp] = xlsread('1.csv','A:A'); to get the first column of the CSV file with 1 row 1.csv .
1.csv contains only one line:
5B0E8795E18013D0FBC33558F0512832,3,7,1, practice, juicer, juicer, true, false, 2347.0.0
However, the returned temp cell is <1048576x1>. Should temp be cell <1x1>?
The parameter 'A:A' should only return existing rows of the first column, as shown in the example “Reading a data column” in the xlsread () documentation . Since temp is a cell <1048576x1>, it seems that using 'A:A' returns the entire column, including nonexistent rows (1048576 is the maximum number of rows in Microsoft Excel 2010).
Using textscan() works fine (= datatemp in the following snippet will only have 1 line):
fid = fopen('1.csv','r'); datatemp = textscan(fid, '%s %d %d %d %s %s %s %s %s %d %d', 'delimiter',',', 'CollectOutput',true) fclose(fid);
However, I do not understand why xlsread() not working properly. I am using MATLAB R2012a 64-bit, Microsoft Excel 2010 and Windows 7 x64.