


% -*- texinfo -*-
% @deftypefn {Function File} {@var{lut} = } makelut (@var{fun},@var{n})
% @deftypefnx {Function File} {@var{lut} = } makelut (@var{fun},@var{n},@var{P1},@var{P2},...)
% Create a lookup table which can be used by applylut.
%
% lut = makelut(fun,n) returns a vector which can be used by applylut
% as a lookup table.
%
% @var{fun} can be a function object as created by inline, or simply a
% string which contains the name of a function. @var{fun} should accept a
% @var{n}-by-@var{n} matrix whose elements are binary (0 or 1) and
% returns an scalar (actually anything suitable to be included in a
% vector).
%
% makelut calls @var{fun} with all possible matrices and builds a
% vector with its result, suitable to be used by applylut. The length
% of this vector is 2^(@var{n}^2), so 16 for 2-by-2 and 512 for 3-by-3.
%
% makelut also passes parameters @var{P1}, @var{P2}, .... to @var{fun}.
%
% @seealso{applylut}
% @end deftypefn