Statistics Toolbox | ![]() ![]() |
Read file containing tab-delimited numeric and text values
Syntax
Description
tdfread
displays the File Open dialog box for interactive selection of the data file. The file should consist of columns of values, separated by tabs, and with column names in the first line of the file. Each column is read from the file and assigned to a variable with the specified name. If all values for a column are numeric, the variable is converted to numbers; otherwise the variable is a string matrix. After all values are imported, tdfread
displays information about the imported values using the format of the whos
command.
tdfread('filename')
allows command line specification of the name of a file in the current directory, or the complete pathname of any file.
indicates that the character specified by tdfread
('filename','delimiter
')
'
delimiter
'
separates columns in the file. Accepted values are:
The default delimiter is 'tab'
.
Example
type sat2.dat Test,Gender,Score Verbal,Male,470 Verbal,Female,530 Quantitative,Male,520 Quantitative,Female,480 tdfread('sat2.dat',',') Name Size Bytes Class Gender 4x6 48 char array Score 4x1 32 double array Test 4x12 96 char array Grand total is 76 elements using 176 bytes
See Also
tblread
![]() | tcdf | tinv | ![]() |