% and gate with n inputs
% release date 2016.11.14
% Prof Frank Urban urban@fiu.edu

classdef NandGate
    properties
        in
        out
    end
    methods
        function obj = NandGate
        end
        function obj = applyInputs(obj,in)
            if islogical(in)
                obj.in = in;
                totInputs = size(in,2);
                obj.out = logical(1);
                for nInput = 1:totInputs
                    obj.out = obj.out && obj.in(nInput);
                end
                obj.out = ~obj.out;
            else
                fprintf(2,'\n ERROR: inputs must be logical - no changes made\n')
            end
        end
    end
end
        