
This article explains the steps involved in interfacing the VANETs toolbox of NetSim with MATLAB with an example.
In this example, we have tried to cover the following type of communication
V2V Communication
V2I Communication
V2X Communication
UAV-to-UAV Communication
UAV-to-Ground Station Communication
| Applicable Version | NetSim Standard | NetSim Pro |
| Applicable Release | v13.0 / v13.1 / v13.2 |
| MATLAB Version | 2020b (UAV Toolbox) |
Introduction:
NetSim has a variety of Mobility models in infrastructure-less network toolboxes. Especially in VANETs, NetSim interfaces with the third-party tool (SUMO) Simulation of Urban Mobility for road traffic simulation, whereas vehicle to vehicle (V2V) or vehicle to Infrastructure communication is simulated in NetSim.
In this example, we are interfacing NetSim with MATLAB for UAV Drone simulation and simulating the communication between UAV to UAV or UAV to Vehicle or UAV to Ground Station in NetSim.
NetSim Scenario:

Configuration Properties in NetSim
Note :
Please refer VANET Technology library and VANET Knowledge Base for how to interface VANET with SUMO. This article is only focused on how to interface with MATLAB
Steps involved in interfacing VANET with MATLAB Module:
Upon interfacing NetSim with MATLAB the following tasks are performed during the simulation start:
Upon simulating a network created in NetSim the following tasks are performed periodically:
During the Simulation, the SIMULINK Model is started and paused several times for NetSim and SIMULINK simulations to run synchronously. The X, Y, and Z coordinates obtained from SIMULINK are read from the MATLAB workspace and given as input to NetSim's Mobility model. In this example, coordinates are taken every second and updated to the UAV device's mobility.
Project Download Link:
![]() |
Follow the instructions specified in the following link to download and set up the project in NetSim: https://support.tetcos.com/en/support/solutions/articles/14000128666-downloading-and-settingup-netsim-file-exchange-projects
Running VANET-MATLAB Interfacing project:
Results and Plots:

NetSim, SUMO and MATLAB Simulation:

Additional Links:
MATLAB Interfacing Basics: How to interface NetSim and MATLAB? : NetSim Support Portal (tetcos.com)
Simulink Interfacing: Interfacing NetSim and SIMULINK : NetSim Support Portal (tetcos.com)