C Math Library Reference    
mlfIndexDelete

Deletes from the target array the element (or elements) specified by the subscript

C Prototype

Arguments
mxArray **pa
   Specifies the address of the array you want to delete elements from.

const char* index_string
   A string that specifies the dimensionality of the subscript and the style of indexing (array indexing or cell array indexing) that is applied to the target array. Use a ? in place of each index value, for example, "(?,?)". mlfIndexRef() does not use index values specified in the subscript string.

mxArray* arguments
   [Optional] Arrays that specify the index values.

You do not need to terminate the list of arguments with NULL; the indexing functions can detect the number of expected arguments.

Return

Returns a pointer to the modified array.

Description

Use the function mlfIndexDelete() to delete elements from an array. This function is equivalent to the MATLAB statement, A(B) = []. The MATLAB C Math Library removes the elements and shrinks the array.

When you delete a single element from a matrix, the matrix is converted into a row vector that contains one fewer element than the original array. You can also delete more than one element from an array, shrinking the array by that number of elements. To retain the rectangularity of a matrix, however, you must delete one or more entire rows or columns.

Example

This code removes the element at row three, column one from array A. Note that removing an element from a matrix reshapes the matrix into a vector.

See Also

mlfIndexRef, mlfIndexAssign


 mlfIndexAssign mlfIndexRef