Python Use Function Output Matlab For Loop