Using the C Math Library | ![]() ![]() |
Deleting Multiple Elements
You can 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. For example,
mlfIndexDelete(&A, "(?,?)", mlfScalar(2), mlfCreateColonIndex());
produces this rectangular result:
1 4 7 3 6 9
Similar to reference and assignment, two-dimensional deletion extends to N-dimensions. If A
has more than two dimensions, simply specify more than two dimensions in the index string and pass more than two index values.
![]() | Deleting Array Elements | Cell Array Indexing | ![]() |