Using the C Math Library    

Deleting Array Elements

Use the function mlfIndexDelete() 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 matrix. The MATLAB C Math Library removes those elements and shrinks the array.

For example, to delete elements from example matrix A, you simply pass the target array, the index string, and the value of the indices that identify the elements to be removed.

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. For example, when element (8) is deleted from matrix A

matrix A becomes this row vector with element 8 missing:


 Extending Two-Dimensional Assignment to N Dimensions Deleting Multiple Elements