www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@localbspline/localbspline.m

    function bs = localbspline(knots,nf)
%LOCALBSPLINE Local b-spline model constructor
%
%  M = LOCALBSPLINE constructs a new local b-spline model.

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


if nargin==0
   knots =1;
elseif nargin==2 && strcmp(knots,'nfactors')
    % L = localbspline('nfactors',nf)
    if nf~=1
        error(message('mbc:localbspline:InvalidValue'));
    end
    knots = 1;
end

bs.version = 1;
bs.fitparams = struct('randstart',2,...
   'jfac',[]);

m = xreg3xspline('nfactors',1);
set(m,'numknots',knots);

bs = class(bs,'localbspline',localmod,m);

n = size(bs,1);
bs = AddFeat(bs,zeros(n,1),1:n);