Matlab code for neural network