function [S,c] = scmat(nr,L);
% [S,c] = scmat(nr,L);
% PURPOSE:
% Make matrices S and c in the relationship, u(k,L) = S du(k,L) + c u(k-1)
%

S=zeros(nr*L,nr*L); c=zeros(nr*L,nr);
%
for i=1:L
  for j=1:i
    S((i-1)*nr+1:i*nr,(j-1)*nr+1:j*nr)=eye(nr);
  end
end
%
for i=1:L
  c((i-1)*nr+1:i*nr,:)=eye(nr);
end
%
% END FUNCTION SCMAT