MATLAB C++ Math Library
  Go to function:
    Search    Help Desk 
end    See Also

Generate the last index for an array dimension

C++ Prototype

Arguments

mat
  Array

x
  The dimension where end() is used. (1 = row , 2 = column)

y
  Number of indices in the subscript (for two-dimensional indexing, always 2; for one-dimensional indexing, always 1).

C++ Syntax

This example selects all but the first element in row three from array A :

MATLAB Syntax

Description

end(&mat, &x, &y) generates the last index for an array dimension. It acts like end in the MATLAB expression A(3, 6:end). x is the dimension to compute end for.

The end() function, which corresponds to the MATLAB end() function, provides another way of specifying a vector index. Given an array, a dimension (1 = row , 2 = column), and the number of indices in the subscript, end() returns the index of the last element in the specified dimension. Given the row dimension, end() returns the number of columns. Given the column dimension, it returns the number of rows. For a matrix and one-dimensional indexing, end() treats the matrix as a vector and returns the number of elements in the matrix.

See Also



[ Previous | Help Desk | Next ]