|
Contents | Previous | Next | Subchapters |
| Syntax |
i = find(flag) |
[i, j] = find(flag) | |
[i, j, nz] = find(flag) | |
| See Also | find string , nnz |
i(k), j(k) and nz(k)
all correspond to the k-th nonzero element of flag
in column major order
.
i = find(flag)
If only one return value is specified,
the indices in i
correspond to the column major ordering of the matrix flag.
[i, j] = find(flag)
If two or three return values are specified,
the values in i correspond to the row indices
and j correspond to the column indices of the matrix flag.
[i, j, nz] = find(flag)
If three return values are specified,
the values in nz are the elements of flag
that are not equal to zero.
find([1, 0, 1])
O-Matrix will reply
[ 1 , 3 ]
If you enter
x = [{0 , 1}, {0, 2}]
find(x)
O-Matrix will reply
{
2
4
}