Khurapati Matlab / The formula above can me coded in matlab easily, like this: