horizontal

Prev Next

Function Names

horizontal

Description

Converts a vector (parameter set) or (vertical 1D) matrix (nested parameter set) to a horizontal 1D-matrix. In other words: The 2-level parameter set structure is flattened and then all of contents is pushed into a 2nd level so the result looks always like {{ a,b,c,... }}.

The matrices may contain contents of all data types and not just numerals.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
parameter set
matrix
Matrix

Vector or matrix to change to a horizontal matrix

Return value

TypeDescription
matrix Horizontal matrix

Examples

      echo( horizontal ( {1,2,abc } ) );     // returns {{1,2,abc}}
      echo( horizontal( {{1},{2},{abc}} ) ); // Same (vertical to horizontal matrix)
      echo( horizontal( {{1,2,abc}} ) );     // Same (is already a horizontal matrix)
      echo( horizontal( { } ) );             // returns { }  (empty set)

Output

{{1,2,'abc'}}
{{1,2,'abc'}}
{{1,2,'abc'}}
{{}}
Try it yourself: Open LIB_Function_horizontal.b4p in B4P_Examples.zip. Decompress before use.

See also

vertical
flat
diagonal