Explode: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
(Importing text file)
Line 7: Line 7:


:explode(sdat,mod,txt,out)
:explode(sdat,mod,txt,out)
:options = explode('options')


===Description===
===Description===
Line 18: Line 16:
===Options===
===Options===


* '''''options''''' =  a structure array with the following fields:
''options'' =  a structure array with the following fields:


* '''model''': [ 'no' | {'yes'} ] interpret sdat as model if possible, and
* '''model''': [ 'no' | {'yes'} ] interpret sdat as model if possible, and

Revision as of 16:33, 3 September 2008

Purpose

Extracts variables from a structure array.

Synopsis

explode(sdat,mod,txt,out)

Description

EXPLODE writes the fields of the input structure sdat to variables in the workspace with the same variable names as the field names. If sdat is a standard model structure, only selected information is written to the workspace.

Optional string input txt appends a string to the variable output names.

Options

options = a structure array with the following fields:

  • model: [ 'no' | {'yes'} ] interpret sdat as model if possible, and
  • display: [ 'off' | {'on'} ]} display model information.

The default options can be retreived using: options = explode('options');.

Examples

For the structure array x

>> x.field1 = 2;

>> x.field2 = 3;

>> explode(x)

Input (sdat) is not a recognized model. Exploding as regular structure

>> whos

 Name         Size                   Bytes  Class
 field1       1x1                        8  double array
 field2       1x1                        8  double array
 x            1x1                      264  struct array

the variables field1 and field2 have been written to the base workspace.

See Also

analysis, modelstruct