LEACH算法的MATLAB代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% SEP: A Stable Election Protocol for clustered %
% heterogeneous wireless sensor networks %
% %
% (c) Georgios Smaragdakis %
% WING group, Computer Science Department, Boston University %
% %
% You can find full documentation and related information at: %
% /sep %
% %
% To report your comment or any bug please send e-mail to: %
% gsmaragd@ %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% This is the LEACH [1] code we have used. %
% The same code can be used for FAIR if m=1 %
% %
% [1] W.R.Heinzelman, A.P.Chandrakasan and H.Balakrishnan, %
% "An