www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contable2/setActiveIndices.m
function con = setActiveIndices(con, newAi) %SETACTIVEINDICES Set the indices of the active factors for a 2d table constraint % % CON = SETACTIVEINDICES(CON, AI) % % This method keeps break points and table information for active indices % that are not changing. Where the active indices change the break points % and the table values are reset to senible defaults based on the % appropriate active factor and the current settings for the constraint. % % See also CONBASE, % CONBASE/GETACTIVEINDICES, % CONBASE/GETACTIVEFACTORS, % CONBASE/NACTIVEFACTORSALLOWED, % CONBASE/SETMATCHEDFACTORS. % Copyright 2004-2005 The MathWorks, Inc. if numel( newAi ) ~= 3, error(message('mbc:contable2:InvalidArgument1')); end newAi = newAi(:).'; oldAi = getActiveIndices( con ); cif = getInputFactors( con ); if newAi(1) ~= oldAi(1), con.breakcols = linspace( cif(1).Min, cif(1).Max, length( con.breakcols ) ); end if newAi(2) ~= oldAi(2), con.breakrows = linspace( cif(2).Min, cif(2).Max, length( con.breakrows ) ); end if newAi(3) ~= oldAi(3), if con.le, con.table(:) = cif(3).Max; else con.table(:) = cif(3).Min; end end % Set the active indices in the parent object con.conbase = setActiveIndices( con.conbase, newAi ); %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|