deleteexpvar
DELETEEXPVAR - Delete a variable from the experiment.mat file in a DIRSTRUCT
DELETEEXPVAR(MYDIRSTRUCT,NAMETOBEDELETED)
Deletes an experiment variable from the DIRSTRUCT given.
NAMETOBEDELETED can be a single string or should be a cell list of strings of variable names.
Note that there must be enough memory to read in the entire
set of saved variables for the DIRSTRUCT.
If one also wants to save some new data to the DIRSTRUCT, one can pass additional
arguments:
DELETEEXPVAR(MYDIRSTRUCT, NAMETOBEDELETED, ADDITIONALVARS, ADDITIONALVARNAMES, PRESERVE_ASSOCIATES)
This will delete the variables titled NAMETOBEDELETED, and add variables with names
ADDITIONALVARNAMES with data ADDITIONALVARS. ADDITIONALVARNAMES and ADDITIONALVARS
should be cell lists, so that ADDITIONALVARNAMES{i} is the name of the variable whose
data is ADDITIONALVARS{i}. If PRESERVE_ASSOCIATES is 1, then any associates of MEASUREDDATA objects
are preserved. This form is functional equivalent to:
DELETEEXPVAR(MYDIRSTRUCT,NAMETOBEDELETED);
SAVEEXPVAR(MYDIRSTRUCT,ADDITIONALVARS,ADDITIONALVARNAMES,PRESERVE_ASSOCIATES);
but doing this in one step requires much less disk access and is faster.
See also: DIRSTRUCT, SAVEEXPVAR, GETEXPERIMENTFILE