Azzera filtri
Azzera filtri

I have an algorithm attached below and I have to write a matlab code from that algorithm. Can anyone please help me??

1 visualizzazione (ultimi 30 giorni)
Define N global variable
Get N (total number of nodes in the network)
Get border_lines (Left_line, Right_line, Top_line, Bottom_line)
Divide_Network_to_Four_Zones (Zl, Zr,Zu, Zw)
for all zones i do
Nz[i] <- Get
Number_of_nodes_per_zone[i]
dz[i]^ Nz/N
if dz[i]>0.25 then
density_factor[i] <- High
else if 0.25 > density_factor[i] > 0.15
then
density_factor[i] <- Midium
else if 0.15 > density_factor[i]
density_factor[i] <- Low
end if
Broadcast density_factor[i]
if density_factor[i] <- High then
Devide_Zone_to_Four_Clusters[i]
for all Clusters j do
for all nodes k do
Node_Membership[i] [j] [k]
if No_Membership [j ] [i] [k] then
Delete_Cluster
end if
end for
end for
else if density_factor[i] <- Medium
then
Devide_Zone_to_Two_Clusters[i]
for all Clusters j do
for all nodes k do
Node_Membership[i] [j] [k]
if No_Membership[j][i][k] then
Delete_Cluster
end if
end for
end for
else if density_factor[i] <- Low then
Devide_Zone_to_One_Clusters[i]
for all Clusters j do
for all nodes k do
Node_Membership[j] [i] [k]
if No_Membership [j ] [i] [k] then
Delete_Cluster
end if
end for
end for
end if
end for
  1 Commento
Ankit
Ankit il 19 Nov 2019
It is better to try yourself in MATLAB first and try to post the questions when you face problem. I would recommend you to first go through the MATLAB Onramp course.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su WSNs in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by