www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@sweepsetfilter/removeVariable.m

    function obj = removeVariable(obj, variablesToRemove)
%REMOVEVARIABLE Remove a variable
%
%  SSF = REMOVEVARIABLE(SSF, VARINDEX) removes the variables at VARINDEX.

%  Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc.


% Logical matrix of 1's of length obj.variables
lVariables = true(1, length(obj.variables));

% Set the filters to remove to be 0
lVariables(variablesToRemove) = false;

% Update the variables field
obj.variables = obj.variables(lVariables);

% Update the object from the least variable changed 
obj = updatevariable(obj, [], min(variablesToRemove));

% Tell everyone that the variables have changed
queueEvent(obj, 'ssfVariablesChanged');