www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptimtablefiller/private/pGetNamedFillFn.m

    function fillfn = pGetNamedFillFn(fillfnname)
%PGETNAMEDFILLFN Get a fill function by name
%
%  FILLFN = PGETNAMEDFILLFN(FILLFNNAME) returns a fill function from the
%  list of possible fill functions. The fill function returned must have
%  the name FILLFNNAME. If the fill function with name, FILLFNNAME, does
%  not exist, them FILLFN = [] is returned.

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


% Get the list of all fill functions
[allfillfn, allfillfnnames] = pGetFillFns;

% Try to match by name
ind = strncmp({fillfnname}, allfillfnnames, length(fillfnname));
ind = find(ind);

% Return fill function if possible
if ~isempty(ind)
    fillfn = allfillfn{ind(1)};
else
    fillfn = [];
end