Modeling biomechanical functions in Matlab