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

    function [con, ok] = fitglobal( con, X, rfd )
%FITGLOBAL Fits the global models to given response feature data
%
%  [C, OK] = FITGLOBAL(C,X,RFD) fits the global models in the two-stage
%  constraint object C to the given response feature data, RFD, at the
%  given global points, X.   

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


for i = 1:size( rfd, 2 );
    [gm, ok] = fitmodel( con.Global{i}, X, rfd(:,i) );
    if ok > 0,
        % We need to ensure that the fit algorithm has not been set to some
        % "quick" method.
        gm = set( gm, 'fitalg', 'hybridrbffit' );
        % Store the global model
        con.Global{i} = gm;
    end
end

con.LocalFriend = [];