# padarray (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: matrix

Requires: MathScript RT Module

## Syntax

padarray(x, n)

padarray(x, n, element)

padarray(x, n, option)

padarray(x, n, element, direction)

padarray(x, n, option, direction)

## Description

Adds elements to an array. padarray(x, n) adds n zeros to both ends of x.

Examples

## Inputs

Name Description
x Specifies an array to add elements to. x is a vector or matrix.
n Specifies the number of elements to add to each dimension of x. n is a vector. The length of n must be equal to the number of dimensions of x.
element Specifies the element to add to x repeatedly. element is a scalar. The default is 0.
option Specifies how to add elements to x. option is a string that accepts the following values:

 'circular' Adds elements by circularly repeating the existing elements. 'replicate' Adds elements by repeating the element on the border. 'symmetric' Adds elements by mirroring elements about the border.
direction Specifies the direction to add elements to x. direction is a string that accepts the following values:

 'both' (default) Adds elements to both ends of x. 'pre' Adds elements before the start of x. 'post' Adds elements after the end of x.

## Outputs

Name Description
y Returns x with added elements.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes Supported on RT targets Yes Suitable for bounded execution times on RT Not characterized

## Examples

X = rand(10, 1)
Y = padarray(X, 6, 0, 'post')
Z = fft(Y)

Not Helpful