Indexing

To index, create a selection of a subset of elements from a vector, matrix or signal.

For example:

We can use four indexing methods to get elements from the signal above.

Calulator Input

Use the [ and ] buttons to complete the operation.

Vector Index: x[i]

The operation returns the component with index i of the input object x. If x has n components, i may be some integer value between 0 and n-1. If x is a signal this operation returns a vector with the abscissa value in the first cell and the corresponding ordinates of every channel in the following cells.

Types

 Variable NameValue TypeVariable Type
Arguments:xreal, complexvector, signal, xy-data
irealscalar
Result: z real, complex scalar, vector Example

Example

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[3, 6, 9],[7, 14, 21])
iArgumentREAL00
z Result REAL VECTOR

x[i]
Matrix Index: x[i,j]

The operation returns the entry of the cell with the indices i (row) and j (column) of the matrix. If x has n rows and m columns, i may be an integer between 0 and n-1 and j between 0 and m-1.

In case x is of kind signal this operator returns the data of channel i+1 at the j+1-th timestep. For signals with m channels and n timesteps the valid indices are and .

Types

 Variable NameValue TypeVariable Type
Arguments:xreal, complexmatrix, signal, xy-data
irealscalar
jrealscalar
Result: zreal, complex scalar

Example

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[3, 6, 9],[7, 14, 21])
iArgumentREAL00
jArgumentREAL00
z Result REAL 3x[i,j]
i-th Row: x[i,]

The operation returns the i+1-th row of the matrix x. If x has n rows, i may be an integer between 0 and n-1.

For signals the operation returns the values of the i+1-th channel of the signal x.

Types

 Variable NameValue TypeVariable Type
Arguments:xreal, complexmatrix, signal, xy-data
irealscalar
Result: z real, complex vector

Example

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[3, 6, 9],[7, 14, 21])
iArgumentREAL00
z Result REAL VECTOR

x[i,]
j-th Column: x[,j]

The operation returns the j+1-th column of the matrix x. If x has m columns, j may be an integer between 0 and m-1.

For signals the operation returns the values of the j+1-th timestep of all channels of signal x.

Types

 Variable NameValue TypeVariable Type
Arguments:xreal, complexmatrix, signal, xy-data
jrealscalar
Result: zreal, complex vector

Example:

IDDescriptionTypeValueExpression
xArgumentREAL SIGNAL   signal([0, 0.5, 1],[3, 6, 9],[7, 14, 21])
jArgumentREAL00
zResult REAL VECTOR x[,j]