Explode: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Bob No edit summary |
||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Extracts variables from a structure array. | Extracts variables from a structure array. | ||
===Synopsis=== | ===Synopsis=== | ||
:explode( | |||
:explode(struct,''txt'',''options'') | |||
===Description=== | ===Description=== | ||
EXPLODE writes the fields of the input structure | |||
EXPLODE writes the fields of the input structure <tt>struct</tt> to variables in the workspace with the same variable names as the field names. If <tt>struct</tt> 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. | Optional string input ''txt'' appends a string to the variable output names. | ||
===Options=== | ===Options=== | ||
* model: [ 'no' | {'yes'} ] interpret | ''options'' = a structure array with the following fields: | ||
* display: [ 'off' | {'on'} ]} display model information. | * '''model''': [ 'no' | {'yes'} ] interpret <tt>struct</tt> as a PLS_Toolbox model if possible, and | ||
* '''display''': [ 'off' | {'on'} ]} display model information. | |||
===Examples=== | ===Examples=== | ||
For the structure array x | For the structure array x | ||
<pre> | |||
>> x.field1 = 2; | >> x.field1 = 2; | ||
>> x.field2 = 3; | >> x.field2 = 3; | ||
>> explode(x) | >> explode(x) | ||
Input (sdat) is not a recognized model. Exploding as regular structure | Input (sdat) is not a recognized model. Exploding as regular structure | ||
>> whos | >> whos | ||
Name Size Bytes Class | Name Size Bytes Class | ||
field1 1x1 8 double array | field1 1x1 8 double array | ||
field2 1x1 8 double array | field2 1x1 8 double array | ||
x 1x1 264 struct array | x 1x1 264 struct array | ||
the variables field1 and field2 have been written to the base workspace. | the variables field1 and field2 have been written to the base workspace. | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[analysis]], [[modelstruct]] | |||
[[analysis]], [[modelstruct]], [[modlpred]], [[mpca]], [[npls]], [[parafac]], [[pca]] |
Latest revision as of 09:59, 9 October 2008
Purpose
Extracts variables from a structure array.
Synopsis
- explode(struct,txt,options)
Description
EXPLODE writes the fields of the input structure struct to variables in the workspace with the same variable names as the field names. If struct 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 struct as a PLS_Toolbox model if possible, and
- display: [ 'off' | {'on'} ]} display model information.
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.