how can calcuate the energy consumption of wsn???????​?????!!!!!​!!!!!!!!!

5 次查看(过去 30 天)
hello
i implement a wsn in matlab and i want to calculate the energy of transmission and reception of sensor node
how can i do
net = [1:n;rand([1,n])*x;rand([1,n])*y];
net1 = net;
hold on;
plot(net(2,:),net(3,:),'bo','MarkerSize',5,'MarkerFaceColor','b');
plot(S.X,S.Y,'or','MarkerSize',10,'MarkerFaceColor','r');
grid on
title('\color[rgb]{0 .5 .5}Déploiement de réseau de capteur sans fil', 'FontSize', 12);
xlabel('Longeur \rm [m] \rightarrow', 'FontSize', 12);
ylabel(' Largeur \rm [m] \rightarrow','FontSize', 12);
v = net(1,:)';
s = int2str(v);
text(net(2,:)+1,net(3,:)+1,s,'FontSize',8,'VerticalAlignment','Baseline');
text(S.X+1,S.Y+1,'sink','FontWeight','bold','FontSize',10,'color','k','VerticalAlignment','Baseline','FontName','Cambria');
%%%%%%%%%%%%%%%%%%%%%%%%%%Densite%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
densite=n/10000;%densite=(n*pi*R^2)/10000; %densite de reseau
set(handles.edit5, 'string',densite );
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Energie total de reseau%%%%%%%%%%%%%ù
Eo=1;
E_totale=n*Eo;
E=num2str(E_totale)

回答(1 个)

iram fatima
iram fatima 2020-5-8
net = [1:n;rand([1,n])*x;rand([1,n])*y];
net1 = net;
hold on;
plot(net(2,:),net(3,:),'bo','MarkerSize',5,'MarkerFaceColor','b');
plot(S.X,S.Y,'or','MarkerSize',10,'MarkerFaceColor','r');
grid on
title('\color[rgb]{0 .5 .5}Déploiement de réseau de capteur sans fil', 'FontSize', 12);
xlabel('Longeur \rm [m] \rightarrow', 'FontSize', 12);
ylabel(' Largeur \rm [m] \rightarrow','FontSize', 12);
v = net(1,:)';
s = int2str(v);
text(net(2,:)+1,net(3,:)+1,s,'FontSize',8,'VerticalAlignment','Baseline');
text(S.X+1,S.Y+1,'sink','FontWeight','bold','FontSize',10,'color','k','VerticalAlignment','Baseline','FontName','Cambria');
%%%%%%%%%%%%%%%%%%%%%%%%%%Densite%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
densite=n/10000;%densite=(n*pi*R^2)/10000; %densite de reseau
set(handles.edit5, 'string',densite );
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Energie total de reseau%%%%%%%%%%%%%ù
Eo=1;
E_totale=n*Eo;
E=num2str(E_totale)
  1 个评论
Walter Roberson
Walter Roberson 2020-5-9
This is exactly the same as the user code, except that it leaves out an empty line that the user had. It is not clear how this is an answer to the question ?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 WSNs 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by