Backward Recursion Dynamic Programming Matlab