Introduction - If you have any usage issues, please Google them yourself
I found the java version of this code in:https://galweejit.wordpress.com/2010/12/16/ai-class-implementation-of-mdp-grid-world-from-week-5-unit-9/
I coverted it to Matlab code and I made it with graphical representation.
The code accepts only one obstacle sink value.
You can change terminals, obstacle and start positions.