Reads a file with data in a row/column format. User can import numerical values stored in text files with the readdata command. The data must be correctly formatted so each row has the same number of columns. Readdata will ignore any line that begins with a letter. The supported file format is ASCII.
Will load the text file filename into matrix variable M. Any lines starting with a letter are ignored.
Note: This function will check for the file in the current working directory. If the file to read from is in a different directory, either specify the full path or change the current working directory.
If you have a text file called testfile.txt with the following data:
The first rows contains the column headers, and the next four rows contain data. In this case, readdata will ignore the first line, and import the data as a 4x2 matrix.