| MATLAB C Math Library | Search  Help Desk |
| mlfIndexDelete | Examples See Also |
Deletes from the target array the element (or elements) specified by the subscript
C Prototype
mxArray *mlfIndexDelete(mxArray *volatile *pa,
const char* index_string, ...);
Arguments
mxArray **pa"(?,?)". mlfIndexRef() does not use index values specified in the subscript string.
mxArray* arguments
NULL; the indexing functions can detect the number of expected arguments.
Return
Returns a pointer to the modified array.Description
Use the functionmlfIndexDelete() 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 arrayA. Note that removing an element from a matrix reshapes the matrix into a vector.
/* In MATLAB: A(3,1) = [] */mxArray *A = NULL;mlfIndexDelete(&A, "(3,1)", mlfScalar(3), mlfScalar(1));
See Also
mlfIndexRef, mlfIndexAssign