MatLab code for walking simulation