Convert Python Code To Matlab