Found code added.

Found at:
http://www.mathworks.com/matlabcentral/fileexchange/13728-hopfield-neural-network/content/hopfieldNetwork.m