.. highlightlang:: us .. _findfirst: findfirst ========= .. index:: findfirst .. us.tag findfirst NOTREADYENGLISH :ref:`findfirst` finds the index of the first element that is not 0. .. function:: nIndex = findfirst(rvMatrix) .. us.return **Return Value** *nIndex* is the index. .. us.params **Parameters** .. uparam:: rvMatrix *rvMatrix* is a real vector. .. us.comment **Comment** :ref:`findfirst` works like :ref:`find` but returns only the first element. .. us.example **Example** :: * a = ones(1,20) * a[5,6,8] = 0 * findfirst(a == 0) 5.0000 .. seealso:: :ref:`find` :sub:`id-1150011`