How to deploy sensor nodes in wireless sensor network (3D)

This is a short and simple MATLAB code for deploying the sensor nodes in wireless sensor networks.
151 Descargas
Actualizado 21 sep 2021

Ver licencia

% Author: Junaid Qadir (DITEN, UniGe, Italy)
% Department of Electrical, Electronic and Telecommunications Engineering, and Naval Architecture (DITEN)
% University of Genova, Genova, Italy
% Website: https://junaidqadirqau.wixsite.com/junaid
% Email: jqadar@ele.qau.edu.pk // junaid.qadir@edu.unige.it // junaidqadiqau@gmail.com
% Reference: J. Qadir, U. Ullah, B. Sainz-De-Abajo, B. G. Zapirain, G. Marques and I. de la Torre Diez,
%"Energy-Aware and Reliability-Based Localization-Free Cooperative Acoustic Wireless Sensor Networks,"
%in IEEE Access, vol. 8, pp. 121366-121384, 2020, doi: 10.1109/ACCESS.2020.3006194.
clc % clear command window
close all % close other window
clear all % clear variables
total_number_of_sensor_node=50; % The total number of sensor nodes in the network
x=randi([0,50],1,total_number_of_sensor_node); % x coordinate of each sensor node in the network
y=randi([0,50],1,total_number_of_sensor_node); % y coordinate of each sensor node in the network
z=randi([0,50],1,total_number_of_sensor_node); % z coordinate of each sensor node in the network
plot3(x,y,z,'mo',... % Plot all the nodes in 3 dimension
'LineWidth',1.5,... % Size of the line
'MarkerEdgeColor','k',... % The color of the outer surface of the node. Currently it is set to black color. "k" stand for black.
'MarkerFaceColor',[1 1 0],... % The color of the inside of the node. Currently it is set to yellow color. "[1 1 0]" is a code of yellow color
'MarkerSize',10)
box on
xlabel(' Length (m)') % X-label of the output plot
ylabel(' Width (m)') % Y-label of the output plot
zlabel(' Height (m)') % Z-label of the output plot
title(' Random deployment of the sensor nodes in the network') % Title of the plot
grid on % Activate the grid in background of the plot
% Hold figure 1
hold on
%Note: To change the color, just write "r" for red, "g" for green, "b" for %blue, "m" for magenta, "c" for cyan and so on

Citar como

Junaid Qadir (2024). How to deploy sensor nodes in wireless sensor network (3D) (https://www.mathworks.com/matlabcentral/fileexchange/99609-how-to-deploy-sensor-nodes-in-wireless-sensor-network-3d), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2021a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Etiquetas Añadir etiquetas

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0