This is LEACH routing protocol simulation code using Matlab, taken from the author of SEP routing protocol.