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

    function [A, b] = getLinearForm(con)
%GETLINEARFORM Get the linear form of a constraint
%
%  [A, B] = GETLINEARFORM(CON)
%
%  For the lineat constraint this method is really just an access method. It
%  returns A = CON.A and B = CON.b.
%
%  See also CONCONVEXHULL, CONBASE/GETLINEARFORM.

%  Copyright 2000-2005 The MathWorks, Inc.

A = zeros( size( con.A, 1 ), nFactors( con ) );
if isempty( con.A ),
    % Setting A = 0 and b = 1 will evalaute to 0 <= 1, i.e., that all
    % points are inside which is what we define for an undefined
    % constraint.
    b = 1;
else
    ai = getActiveIndices( con );
    A(:,ai) = con.A;
    b = con.b;
end