tblwrite

Write tabular data to file

Syntax

tblwrite(data,varnames,casenames)
tblwrite(data,varnames,casenames,filename)
tblwrite(data,varnames,casenames,filename,delimiter)

Description

tblwrite(data,varnames,casenames) displays the File Open dialog box for interactive specification of the tabular data output file. The file format has variable names in the first row, case names in the first column and data starting in the (2,2) position.

varnames is a string matrix containing the variable names. casenames is a string matrix containing the names of each case in the first column. data is a numeric matrix with a value for each variable-case pair.

tblwrite(data,varnames,casenames,filename) specifies a file in the current folder, or the complete path name of any file in the string filename.

tblwrite(data,varnames,casenames,filename,delimiter) writes to the file using delimiter as the delimiting character. The following table lists the accepted character values for delimiter and their equivalent string values.

CharacterString
' ''space'
'\t''tab'
',''comma'
';''semi'
'|''bar'

The default value of delimiter is 'space'.

Examples

Continuing the example from tblread:

tblwrite(data,varnames,casenames,'sattest.dat')
type sattest.dat
		             Male  Female
Verbal 			  470	 530
Quantitative		520	 480

See Also

|

Was this topic helpful?