som_write_data
Purpose
Writes data structs/matrices to a file in SOM_PAK format.
Syntax
som_write_data(sD,'filename')
som_write_data(D,'filename')
som_write_data(...,'missing')
Description
This function is offered for compatibility with SOM_PAK, a SOM software
package in C. It writes data structs/matrices to a file in SOM_PAK format.
See SOM_READ_DATA for a decription of the SOM_PAK data file format. Since
the format does not support information on normalizations, that
information is lost, as well as the data name. The component names are
written on a comment line which begins with '#n' and label names on
comment line which begins with '#l', respectively. Any spaces (' ') in the
component names and in the label names are replaced with
underscores ('_').
This function is only offered for compatibility with SOM_PAK. In
general, when saving data in files, use 'save filename.mat sData'. This is
faster and retains all information of the data struct.
The string to use for missing values (NaNs) in the written file can
be given with the last argument. Notice that if you use SOM_PAK to
read the files, you need to set the SOM_PAK environment variable
LVQSOM_MASK_STR accordingly, e.g. to 'NaN' if you use the default
replacement. For more information, see the SOM_PAK instructions.
Required input arguments
data (struct or matrix) data to be written
filename (string) output filename
Optional input arguments
missing (string) string used to denote missing components (NaNs);
default is 'NaN'
Examples
The basic usage is:
som_write_data(sData,'system.data')
To write a data matrix to a file in plain SOM_PAK format, give a
data matrix as the first argument:
som_write_data(D,'system.data')
By default, all NaNs in the data matrix are written as 'NaN':s. The
third argument can be used to change this:
som_write_data(sData,'system.data','+')
som_write_data(sData,'system.data','missing')
See also