Added example code for matlab integration