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

    function [A,b]=linearConstr(c);
%LINEARCONSTR

%  Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc.



A = cell( size( c.Constraints ) );
b = cell( size( c.Constraints ) );
for n=1:length(c.Constraints)
   if islinear(c.Constraints{n})
       [A{n}, b{n}] = getLinearForm( c.Constraints{n} );
   end
end

A = cat( 1, A{:} );
b = cat( 1, b{:} );

% in the case that there are no linear constraint, we need to ensure that
% we return matrices of the correct sizes.
if isempty( A ),
    A=zeros(0,length(c.Factors));
    b=[];
end