How to calculate value and policy function in Dynare

For the value function, see [Compute value function in Dynare). For the policy function, see the output of the decision rules Dynare provides after running stoch_simul. On my homepage you can find a Matlab function to plot the policy functions.