Experimental code for matlab