matlab-simulate-wireless-network

Set up and run system-level wireless network simulations with wirelessNetworkSimulator in MATLAB.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-simulate-wireless-network
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-simulate-wireless-network
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/wireless-communications/matlab-simulate-wireless-network
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-simulate-wireless-network

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building system-level wireless network simulations in MATLAB involves many subtle API rules—singleton simulator initialization, abstract node classes, traffic source units, callback signatures, and instrumentation setup—that are easy to get wrong and produce silent errors or infinite loops. This Skill encodes the correct workflow, conventions, and common-mistake fixes so simulations run correctly the first time.

Core Features & Use Cases

  • End-to-End Simulation Workflow: Covers the full sequence from wirelessNetworkSimulator.init through node creation, traffic sources, mobility, instrumentation, batch addNodes, run, and statistics extraction.
  • Custom Node Development: Provides the complete pattern for subclassing wnet.Node, including the five required method overrides, wirelessPacket structure, interference buffering, and event callback implementation.
  • Instrumentation & Capture: Guides use of wirelessNetworkEventTracer, wirelessIQLogger, wirelessTrafficViewer, wirelessNetworkViewer, and PCAP writers (pcapWriter, blePCAPWriter) for logging and analysis.
  • Use Case: Imagine you need to simulate 10 custom wireless nodes with random-waypoint mobility, log transmission events, and sweep a transmit power parameter across 5 values. This Skill provides the exact code patterns for vectorized node creation, mobility bounds, event tracing, and the parametric sweep loop with mandatory simulator reinitialization.

Quick Start

Ask your AI agent to create a wireless network simulation with wirelessNetworkSimulator that adds traffic sources, mobility, and event tracing, then runs the simulation and extracts statistics.

Frequently Asked Questions about matlab-simulate-wireless-network

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a wireless network simulation in MATLAB?

Start with wirelessNetworkSimulator.init as the first statement, then create nodes, configure connections, add traffic sources with addTrafficSource, optionally add mobility and instrumentation, call addNodes once per technology type, and finish with run(sim, duration) and statistics(node).

How do I create a custom wireless node with wnet.Node?

Subclass wnet.Node and override five public methods: run, pullTransmittedPacket, pushReceivedPacket, isPacketRelevant, and statistics. Use wirelessPacket to build packet structs, guard transmissions with NextTxTime and round(...,9) to avoid infinite loops, and buffer received packets with wnet.internal.interferenceBuffer.

Why does my wireless simulation hang in an infinite loop?

The simulator re-invokes run() at the same currentTime after delivering received packets. If run() transmits unconditionally, nodes ping-pong forever. Track NextTxTime and only transmit when currentTime >= round(NextTxTime, 9), returning NextTxTime as the next invoke time.

Can I use addTrafficSource with a custom wnet.Node subclass?

No. addTrafficSource works only on technology nodes such as bluetoothLENode, bluetoothNode, wlanNode, nrGNB, and nrUE. Custom wnet.Node subclasses must generate traffic inside their run() method instead.

How do I run a parametric sweep with wirelessNetworkSimulator?

Call wirelessNetworkSimulator.init at the top of every loop iteration because the simulator is a singleton that retains state. Recreate all nodes, connections, and traffic each iteration, then run and extract metrics; parfor is supported for independent iterations.

What units does networkTrafficOnOff DataRate use?

DataRate is specified in Kbps, not bps. Setting DataRate=100000 for 100 Kbps actually configures 100 Mbps, which runs without error but produces unrealistic traffic. Use DataRate=100 for 100 Kbps.