I found a solution for my own question. The degrees of freedom can be can be estimated as the trace of the smoothing matrix. This matrix is not returned by ksdensity, but it can be calculated as detailed below. Assume: 'data' is the vector of data and mormalf is the value of a Normal dist. at x= 1st argument, with mean= 2nd argument, and std= 3rd argument.
[Kpdf,mesh,bandw]= ksdensity(data,data);
N= numel(data);
S= zeros(N);
for k= 1:N
S(k,:)= normalf(data,data(k),bandw);
end
degreesfreedom= trace(S);