MATLAB: Importing only a fraction of a database using dataset

data importdataset

I have a large dataset in csv format (400MB). How can I import in MatLab only the first 500 rows?

Best Answer

nc=6; % Number of column in your csv file
nr=500
data=csvread('file.csv',0,0,[0 0 nr-1 nc-1])