MATLAB: Do I receive an error when using the DATASET function to create a dataset from a text file in MATLAB 7.9 (R2009b)

MATLAB

When I use the DATASET command to read information from a text file (or '.dat' file), I receive the following error:
??? Attempted to access line1(1); index out of bounds because numel(line1)=0.

Best Answer

This enhancement has been incorporated in Release 2011a (R2011a). For previous product releases, read below for any possible workarounds:
This error occurs when the data file begins with an "empty" row (carriage return). To avoid this error, ensure that the first line of the data file is properly populated with dataset information.