adding matlab code