1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function x=%i_and(a,flag)
14    // or(a) returns the logical OR
15    // for scalar matrices, an entry is TRUE if it is not zero.
16    //!
17
18    if argn(2)==1 then flag="*",end
19    if flag=="*" then
20        x=find(a==0,1)==[]
21    else
22        x=sum(bool2s(a<>0),flag)==size(a,flag)
23    end
24endfunction
25