Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Русский

Change language to:
English - Français - 日本語 - Português -

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Справка Scilab >> Основные функции > Поиск и сортировка > find


find indices of boolean vector or matrix true elements


[ii]=find(x [,nmax])
[i1,i2,..]=find(x [,nmax])



may be a boolean vector, a boolean matrix, a boolean hypermatrix, a "standard" matrix or hypermatrix


an integer giving the maximum number of indices to return. The default value is -1 which stands for "all". This option can be used for efficiency, to avoid searching all indices.

ii, i1, i2, ..

integer vectors of indices or empty matrices


If x is a boolean matrix,

ii=find(x) returns the vector of indices i for which x(i) is "true". If no true element found find returns an empty matrix.

[i1,i2,..]=find(x) returns vectors of indices i1 (for rows) and i2 (for columns),.. such that x(i1(n),i2(n),..) is "true". If no true element found find returns empty matrices in i1, i2, ...

if x is a standard matrix or hypermatrix find(x) is interpreted as find(x<>0)

find([]) returns []


beers=["Desperados", "Leffe", "Kronenbourg", "Heineken"];
find(beers=="Leffe") // OK
find(beers=="1664") // KO
find(beers=="Foster") // KO
beers=[beers, "Foster"]
find(beers=="Foster") // OK


w=find(B<0.4,2) //at most 2 returned values

H=rand(4,3,5); //an hypermatrix


See also

  • boolean — Объекты Scilab'а, логические переменные и операторы & | ~
  • extraction — выделение элемента матрицы или списка
  • insertion — частичное присвоение или модификация значения переменной
  • vectorfind — ищет в строках или столбцах матриц совпадения с вектором
Report an issue
<< dsearch Поиск и сортировка gsort >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:13:21 CET 2017