stretch#

swordfish.function.stretch()#
  • If X is a vector or tuple, stretches X evenly to a new vector or tuple with the length of n.

  • If X is a matrix or table, stretches X evenly to a new matrix or table with n rows.

The difference between stretch and take lies in:

  • take takes n values iteratively and sequentially from a vector, whereas stretch copies each element of the vector to stretch the vector to a new length n.

Parameters:
  • X (Constant) – A vector/tuple/matrix/table.

  • n (Constant) – A non-negative integer.