function mat = make_deriv_matrix(size,order)

if (order == 0)
  mat = eye(size);
else
  mat = make_deriv_matrix(size-1,order-1) * make_first_deriv(size);
end


function mat = make_first_deriv(size)
% recurse
init = eye(size);

init = init(1:size-1, :);

shift = [init(:,size) init(:,1:size-1)];

mat = init - shift;

