标题: 我的leach协议改进与仿真 含MATLAB源程序 [打印本页]

作者: mww321    时间: 2019-7-6 21:04
标题: 我的leach协议改进与仿真 含MATLAB源程序
这是我最近写的一篇文档中涉及到的leach路由协议的改进算法及其仿真
用了一个星期时间
含源代码和
希望大家多多指教


MATLAB源程序如下:
  1. clear all;clc;close all;

  2. LEACH;
  3. LEACH_opt;

  4. load res1
  5. figure(5);clf;hold on
  6. plot(1:rnd,op(1:rnd),'--k','Linewidth',1);
  7. xlabel '轮数/r';
  8. ylabel '存活节点个数';
  9. hold on;
  10. figure(7);clf;hold on
  11. plot(1:rnd,op(1)-op(1:rnd),'--k','Linewidth',1);
  12. xlabel '轮数/r';
  13. ylabel '死亡节点个数';
  14. hold on;


  15. figure(6);clf;hold on
  16. plot(1:rnd,EnrRes(1:rnd),'--k','Linewidth',1);
  17. xlabel '轮数/r';
  18. ylabel '节点剩余能量平均值';
  19. hold on;

  20. load res2
  21. figure(5)
  22. plot(1:rnd+1,[op(1:rnd) 0],'-k','Linewidth',1);
  23. axis([0 2e4 0 op(1)])
  24. legend('改进前','改进后');
  25. figure(6)
  26. plot(1:rnd,EnrRes(1:rnd),'-k','Linewidth',1);
  27. legend('改进前','改进后');
  28. figure(7);
  29. plot(1:rnd+1,op(1)-[op(1:rnd) 0],'-k','Linewidth',1);
  30. axis([0 2e4 0 op(1)])
  31. legend('改进前','改进后');
复制代码

所有资料51hei提供下载:
Code2.zip (588.4 KB, 下载次数: 42)



作者: 974289358    时间: 2020-4-14 17:31
您好大神,在么,我下载了您这个代码,对我非常有帮助,但是看不明白,希望能跟您加一下q好友,可以向您询问一下这个代码相关的东西
作者: 用心小菜鸟    时间: 2020-5-16 14:28
L楼主能讲讲他的原理嘛
作者: 996479901@    时间: 2022-3-12 19:01
楼主这个代码改进的方向是哪个方面的啊




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1