# CVX "find" command

hello guys, can someone guide me on how to use the find command in CVX. I am not being able to find any example.

Here is the online help, which is the most detailed documentation for the `find` command. I don’t know of any example other than the one in the help below.

help cvx/find

Disciplined convex/geometric programming information for find:
When used in CVX models, find cannot deduce the numeric value of a
CVX variable. So it returns the indices of elements that are
“structurally” nonzero; i.e., that are not identically zero.
This is similar to the concept of structural nonzeros in sparse
matrix factorizations. To illustrate the distinction, consider:
variable x(3);
x(2) == 0;
y = [x(1);0;x(3)];
In this case, find(x) returns [1;2;3] even though x(2) has been set
to zero in an equality constraint. (After all, the overall model may
be infeasible, in which case x(2) is arguably not zero.) However,
find(y) will return [1;3], because y(2) is identically zero.

``````When X is a CVX variable, the first two outputs of [I,J,V]=find(X)
are constant, and the third is a CVX variable containing the
structural nonzeros of X.

find(X) places no convexity restrictions on its argument.``````