matlab code for wearable handle