Update Drawing Region program, Matlab