add onSubscribe event callback for matlab