www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contable2/loadobj.m
function con = loadobj(con) %LOADOBJ Load filter for 2d table constraint objects % % CON = LOADOBJ(CON) % % For old forms of constraints, the LOADOBJ method updates the object % structure and partially increments the version number. Where required, % nominal values will be used for the variable information, etc. Use the % UPGRADE method to update this information. % % See also LOADOBJ, CONBASE/LOADOBJ, CONTABLE2/UPGRADE. % Copyright 2000-2014 The MathWorks, Inc. if con.version == 1.5, warning(message('mbc:contable1:MissedUpgrade')); end if con.version < 3 con.UserData = []; end if con.version <= 1, % Upgrade from version 1 to version 2 structure. % % size: 4 % breakcols: [-1 -0.5000 0 0.5000 1] % breakrows: [-1 -0.5000 0 0.5000 1] % table: [5x5 double] % factors: [1 2 3] % le: 1 % version: 1 % % Create parent abstract class con.conbase = conbase( coninputfactor( con.size ) ); % However, the parent is really only at version 1.5 because it will % need an upgrade con.conbase = pSetVersionNumber( con.conbase, 1.5 ); % The factor information is now stored in the in parent class con.conbase = setActiveIndices( con.conbase, con.factors ); % Remove the size and factors fields from the structure con = mv_rmfield( con, {'size', 'factors'} ); % Partial increment of the version number: con.version = 1.5; else con.version = 3; end if isstruct( con ), % Convert the structure to an object. con = contable2( con ); end %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|