themarkovrandomfieldcode,usingmatlab