Python Array Get Function Matlab Code