www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregmodswitch/getInputMask.m

    function Mask = getInputMask(m,X)
%GETINPUTMASK input mask for active inputs
%    Mask = getInputMask(m,X)

%  Copyright 2009 The MathWorks, Inc. and Ford Global Technologies, Inc.

if nargin<2
    X = m.OpPoints;
end

Index = findOpPoints(m,X);
if ~isempty(m.ActiveFactors)
    Mask = false(size(X,1),m.NumLocalInputs);
    for i=1:size(Mask,1)
        if Index(i)~=0
            Mask(i,m.ActiveFactors{i})= true;
        end
    end
else
    Mask = true(size(X,1),m.NumLocalInputs);
    Mask(Index==0,:)=false;
end