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

    function roles = getInputRoles(con)
%GETINPUTROLES Get the list of role that each input active factor plays
%
%  ROLES = GETINPUTROLES(CON)
%
%  ROLES will be a cell-str of size [1, nActiveFactors( con )].
%
%  The role for an input is any special quality that it has over the other
%  inputs. For example, in a table constraint we distinguish between the input
%  and out to the table.
%
%  See also CONTWOSTAGE, CONBASE/GETINPUTROLES.

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


nlf = nFactors( con.Local );
roles = cell( 1, nFactors( con ) );

% Local input roles
roles(1:nlf) = getInputRoles( con.Local );

% Prefix with "Local:"
for n = 1:nlf
    roles{n} = ['Local: ' roles{n}];  
end

% Global input roles
[roles{(nlf+1):end}] = deal( 'Global' );

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