Added implementation using neural network toolbox