www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contable1/setTable.m

    function con = setTable(con, xBreakpoints, table)
%SETTABLE  Set the breakpoints and values for the table
%
%  CON = SETTABLE(CON, XBREAKPOINTS, TABLE)
%
%  XBREAKPOINTS and TABLE must be vector with the same number of elements. As
%  with everything with constraints, there is no coding so both should be in
%  natural or engineering units.
%
%  See also CONTABLE1, CONTABLE1/GETTABLE.

%  Copyright 2000-2005 The MathWorks, Inc.

% We want to keep everything as rows.
xBreakpoints = xBreakpoints(:)';
table        = table(:)';

% The number of break points must agree with the size of the table
if size( xBreakpoints, 2 ) ~= size( table, 2 ),
    error(message('mbc:contable1:InvalidArguments'));
end
    
% Set the properties of the model
con.breakcols = xBreakpoints;
con.table     = table;

%------------------------------------------------------------------------------|
% EOF
%------------------------------------------------------------------------------|