rls = [ones(NC,1) reshape(1:NI*NC,NC,NI)];

%NC = 5;
%rls = rbfull(NC);
%mfs = mfequ([rlimits(1,1) range(1,:) rlimits(1,2)],2,NC);

nr = size(d,1);
dc = [d(1:lstep:nr,1:NI) ones(size(d(1:lstep:nr,1)))];
dof = dofprod(rls(:,[1 Alist+1]),mfs,dc(:,Alist));
[p,ym,ylm,ylm]=suglms([dc(:,Clist)],d(1:lstep:nr,NI+1),dof);

clear pl2
for i = 1 : NC,
  pl2(i,:)=suglms([dc(:,Clist)],d(1:lstep:nr,NI+1),dof(:,i));
end;