This example shows how to export a dataset array from the MATLAB® workspace to a text or spreadsheet file.
The dataset array has 100 observations and 7 variables.
Export the dataset array,
hospital, to a
text file named
hospital.txt. By default,
to a tab-delimited text file with the same name as the dataset array,
This creates the file
hospital.txt in the
current working folder, if it does not previously exist. If the file
already exists in the current working folder,
the existing file.
By default, variable names are in the first line of the text file. Observation names, if present, are in the first column.
hospital with variable names suppressed
to a text file named
There are no variable names in the first line of the created
hospital to a comma-delimited text
hospital to an Excel® spreadsheet
By default, the first row of
variable names, and the first column has observation names.