flat
In a parameter set, all elements which are also parameter sets (for example matrices), will be flattened by shifting all members upward.
This function is not recursive, i.e. deeper parameter sets beyond 2nd level remain unaffected.
The matrices may contain contents of all data types and not just numerals.
Indirect parameter passing is disabled
1
No. | Type | Description |
---|---|---|
1 input |
parameter set matrix |
Matrix Vector or matrix to flatten to parameter set |
Type | Description |
---|---|
parameter set | Flattened vector |
echo( flat( {1,2,3} ) ); // Returns {1,2,3}
echo( flat( {{1,2,3}} ) ); // Same
echo( flat( {{1},{2},{3}} ) ); // Same
echo( flat( {{{1,2}}, {3}} ) ); // Returns {{1,2},3} (Only 2-level flattening(
{1,2,3}
{1,2,3}
{1,2,3}
{{1,2},3}