www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contable1/resetFromInputs.m
function con = resetFromInputs(con, ResetInd) %RESETFROMINPUTS Reset constraint parameters after input changes % % CON = RESETFROMINPUTS(CON) resets all of the constraint parameters that % depend on input factor settings to their default values. % % CON = RESETFROMINPUTS(CON, IND) assumes that the input factors indicated % by the indices in IND have changed and resets only the parameters that % depended on the settings for those inputs. % Copyright 2005 The MathWorks, Inc. and Ford Global Technologies, Inc. ActiveInd = getActiveIndices(con); cif = getActiveFactors(con); if nargin<2 DO_BREAKS = true; DO_TABLE = true; else DO_BREAKS = any(ActiveInd(1)==ResetInd); DO_TABLE = any(ActiveInd(2)==ResetInd); end if DO_BREAKS con.breakcols = linspace( cif(1).Min, cif(1).Max, length(con.breakcols) ); end if DO_TABLE if con.le con.table = repmat( cif(2).Max, 1, length(con.table) ); else con.table = repmat( cif(2).Min, 1, length(con.table) ); end end