function [result,index] = in(list,value)

% [result,index] = in(list,value)
%           returns 1, if list contains value, otherwise 0.
%           index is the order of the matched value in the list.

m = max(size(list));

result = 0;
index = 0;

for i=1:m
    if list(i) == value
        result = 1;
        index = i;
        break;
    end
end
