Source: http://appliedmaths.sun.ac.za/~htouchette/markovcourse/matlabcommands1.pdf