working with gait, matlab and c