Difference between revisions of "Unflatten"

m
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
[[category:Transforming functions]]
 
[[category:Transforming functions]]
''new to [[Analytica 4.7]]''
+
''new to [[Analytica 5.0]]''
  
== Unflatten(x'', I'', resultIndexes...) ==
+
== Unflatten(x'', i'', resultIndexes...) ==
  
Transforms a one-dimensional vector «x» into a multidimensional array.  
+
Transforms a one-dimensional vector «x» indexed by  «i» into a multidimensional array, indexed by 2 or more «resultIndexes».  
  
«I» is an index of «x», which does not appear in the final result, and will usually be much longer than any of «resultIndexes», which are the dimensions of the final result. The cells in the multi-dimensional array are populated with the values of «x» along «I» in the order obtained by varying the first indexes listed in «resultIndexes» most slowly.
+
«i» is an index of «x», which does not appear in the final result. «resultIndexes» are the dimensions of the final result. The result contains the values of «x» over «i» in the order obtained by varying the first indexes in «resultIndexes» most slowly. Usually, the size of  «i»  is equal to the product of the sizes of the «resultIndexes». If «i» has fewer elements than that, it pads the remaining cells with [[Null]]. If «i» has more elements than needed for the result cells, it ignores the unneeded values along «i».
  
Index «I» can be omitted when your are unflattening along an implicit index, or along the local index created by a previous  call to [[Flatten]] or [[ConcatRows]].
+
You may omit Index «i» when unflattening over an [[implicit index]], or over the local index created by a previous  call to [[Flatten]] or [[ConcatRows]].
 
 
When «I» has fewer elements than cells in the final array, the remaining cells are [[Null]]-padded. When there are more elements than result cells, only the first however-many values are used.
 
  
 
== Examples ==
 
== Examples ==
Line 19: Line 17:
  
 
==History==
 
==History==
Introduced in [[Analytica 4.7]].
+
Introduced in [[Analytica 5.0]].
  
 
== See Also ==
 
== See Also ==

Latest revision as of 18:49, 19 June 2017

new to Analytica 5.0

Unflatten(x, i, resultIndexes...)

Transforms a one-dimensional vector «x» indexed by «i» into a multidimensional array, indexed by 2 or more «resultIndexes».

«i» is an index of «x», which does not appear in the final result. «resultIndexes» are the dimensions of the final result. The result contains the values of «x» over «i» in the order obtained by varying the first indexes in «resultIndexes» most slowly. Usually, the size of «i» is equal to the product of the sizes of the «resultIndexes». If «i» has fewer elements than that, it pads the remaining cells with Null. If «i» has more elements than needed for the result cells, it ignores the unneeded values along «i».

You may omit Index «i» when unflattening over an implicit index, or over the local index created by a previous call to Flatten or ConcatRows.

Examples

Unflatten(1..12, resultIndexes: In1, In2) →
Unflatten ex1.png

History

Introduced in Analytica 5.0.

See Also

Comments


You are not allowed to post comments.