Degrees of freedom

Hi,
I do not know if there is an automatic way. But this thread could be interesting for you.
Best,
Marius