MATLAB: TabularTextDataStore wont store more than 20000 rows


Im trying to import a large csv file (60,000 x 171). tabularTextDataStore is only storing up to 20,000 rows. Is there a more efficient way to import all of the data?

Best Answer

  • The amount of data returned on each call to the read method of a TabularTextDatastore is controlled by the value of the ReadSize property.
    If you want to read more than 20,000 rows on each call to read (20,000 is the default value), then you can adjust the value of ReadSize like so:
    trainSet = tabularTextDatastore("data\trainingSet.csv");
    trainSet.ReadSize = 60000; % You can adjust this value to your liking.
    trainSet.TreatAsMissing = 'na';
    trainSetR = read(trainSet)