| MATLAB C Math Library | Search  Help Desk |
| mlfArrayDelete | Examples See Also |
Delete elements from a one or two-dimensional array.
This routine is superseded bythe mlfIndexDelete() routine, which supports multidimensional, cell array, and structure indexing.
C Prototype
void mlfArrayDelete(mxArray *destination, mxArray *index1, ... );
Arguments
mxArray *destination
mxArray *index1
NULL as the last argument.
Return
This function returnsvoid. The result of the deletion is stored in the argument destination.
Description
Use the functionmlfArrayDelete() to delete elements from an array. This function is equivalent to the MATLAB statement, A(B) = []. Instead of specifying a subscript for the elements you want to replace with other values, specify a subscript for the elements you want removed from the array. The MATLAB C Math Library removes those 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 matrix. You can also delete more than one element from a matrix, shrinking the matrix by that number of elements. To retain the rectangularity of the matrix, however, you must delete one or more entire rows or columns.
Example
mlfArrayDelete(A, three, one, NULL);
This function 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
mlfArrayAssign, mlfArrayRef, mlfColon, mlfCreateColonIndex, mlfEnd