Matlab Related Code by zhihao