K = find(M)
[R, C] = find(M)
[R, C, V] = find(M)
K = find(M, N)
[R, C] = find(M, N)
[R, C, V] = find(M, N)
K = find(M, N, D)
[R, C] = find(M, N, D)
[R, C, V] = find(M, N, D)
| Parameter | Description |
|---|---|
| M | a scalar, vector, matrix, or multidimensional array. |
| N | positive integer scalar value: number of nonzeros to find. |
| D | direction: 'first' (default) or 'last'. |
| Parameter | Description |
|---|---|
| K | indices to nonzero elements (vector). |
| R | row subscripts (vector). |
| C | column subscripts (vector). |
| V | nonzero elements of M (vector). |
K = find(M) returns a vector with the linear indices of each nonzero element of M.
M = rand(4, 3, 5);
[R, C, V] = find(M > 0.9)
M(R(1),C(1),V(1))
| Version | Description |
|---|---|
| 1.0.0 | initial version |