Generated banner for Matlab Simulate Wireless Network
Generated logo for Matlab Simulate Wireless Network

Matlab Simulate Wireless Network

MathWorksOfficialCreated by MathWorks

  • Skill
  • Tool integration
  • Science and research
  • BSD-2-Clause
  • No issues found

From the author

Set up and run wireless network simulations using the Wireless Network Toolbox. Use this skill when creating system-level simulations with wirelessNetworkSimulator, adding traffic sources (networkTrafficOnOff, networkTrafficFTP, networkTrafficVoIP, networkTrafficVideoConference), configuring node mobility, logging events or IQ samples, visualizing traffic, scheduling actions during simulation, running parametric sweeps, writing PCAP files with pcapWriter or technology-specific PCAP writers, registering event callbacks on wireless nodes, accessing event data fields, or combining multiple capture/visualization tools in a simulation.
— the description by MathWorks

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured approach to building and running system-level wireless network simulations. It covers the complete lifecycle of a simulation, from initializing the singleton simulator and defining nodes—whether using built-in technology-specific nodes or custom subclasses—to configuring traffic sources, mobility models, and instrumentation. It also details how to perform parametric sweeps, log events, and capture traffic for analysis, ensuring users can effectively model complex wireless environments.

What it does

  • Initializes system-level wireless network simulations.
  • Configures nodes with specific technologies or custom implementations.
  • Adds traffic sources and mobility models to network nodes.
  • Instruments simulations with event tracers, IQ loggers, and traffic viewers.
  • Schedules periodic or one-shot actions during simulation runtime.
  • Exports simulation data to PCAP files for external analysis.

When to use it

  • When creating system-level wireless network simulations.
  • When you need to model node mobility and traffic patterns.
  • When you need to perform parametric sweeps over simulation parameters.
  • When you need to capture and visualize network traffic or events.
  • When implementing custom wireless nodes that do not fit standard technology models.

Advantages

  • Provides a unified workflow for diverse wireless technologies.
  • Supports both built-in and custom node definitions.
  • Enables detailed instrumentation and logging for performance analysis.
  • Allows for flexible scheduling of simulation actions.
  • Facilitates integration with external analysis tools via PCAP export.

Usage examples

“How do I initialize a new wireless network simulation in MATLAB?”
You must call the singleton simulator using 'sim = wirelessNetworkSimulator.init;' as the first executable statement in your script.
“How can I add random mobility to a group of wireless nodes?”
Use the 'addMobility' method on your node vector, specifying the model (e.g., 'random-waypoint') and the bounds as [x_center, y_center, width, height].
“How do I log simulation events to a file?”
Create a 'wirelessNetworkEventTracer' object, specify the filename, and use 'addNodes' to register the specific events you wish to track for your nodes.
“What is the correct way to add a traffic source to a node?”
Use 'addTrafficSource' on a technology-specific node, providing a traffic object (e.g., 'networkTrafficOnOff') and the destination node(s).

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/matlab/matlab-simulate-wireless-network/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip matlab-simulate-wireless-network.zip -d .agents/skills

Documentation by MathWorks

Wireless Network Simulation Fundamentals

Foundation patterns for system-level wireless simulation. Technology-specific skills build on these for node creation, connection configuration, and KPI extraction.

When to Use

  • Creating system-level wireless network simulations with wirelessNetworkSimulator

  • Adding traffic sources (networkTrafficOnOff, networkTrafficFTP, networkTrafficVoIP, networkTrafficVideoConference)

  • Configuring node mobility (random waypoint, custom models)

  • Logging events or IQ samples with wirelessNetworkEventTracer or IQ logger

  • Visualizing traffic with wirelessTrafficViewer and network layout with wirelessNetworkViewer

  • Scheduling actions during simulation with scheduleAction

  • Running parametric sweeps over simulation parameters

  • Writing PCAP files with pcapWriter or technology-specific PCAP writers

  • Creating custom nodes by subclassing wnet.Node

  • Registering event callbacks on wireless nodes

When Not to Use

  • PHY-layer or link-level simulations without wirelessNetworkSimulator

  • Bluetooth-specific topology setup (use matlab-simulate-bluetooth-network instead)

  • WLAN-specific or 5G NR-specific configuration (use the respective technology skills)

  • Signal processing or waveform generation tasks

Node Creation

All nodes in the simulator inherit from wnet.Node. Choose the correct node type:

TechnologyNode ConstructorNotes
Bluetooth LEbluetoothLENode("central") / bluetoothLENode("peripheral")Use the matlab-simulate-bluetooth-network skill
Classic Bluetooth BR/EDRbluetoothNode("central") / bluetoothNode("peripheral")Use the matlab-simulate-bluetooth-network skill
WLANwlanNode(...)Requires WLAN Toolbox
5G NRnrGNB(...) / nrUE(...)Requires 5G Toolbox
Any other / customSubclass wnet.NodeSee references/custom-node.md

wnet.Node is abstract — never instantiate it directly. If the scenario does not use a specific technology listed above, you MUST create a custom node class that inherits from wnet.Node. Technology nodes (bluetoothLENode, bluetoothNode, wlanNode, nrGNB, nrUE) implement the wnet.Node interface internally — properties like Position, ID, Name, Velocity, addMobility, registerEventCallback, and statistics work on all node types.

Workflow

Every system-level simulation follows this order:

  1. wirelessNetworkSimulator.init (MUST be first)

  2. Create nodes — use technology-specific constructors when available, otherwise subclass wnet.Node (see references/custom-node.md)

  3. Configure connections (technology-specific)

  4. addTrafficSource (technology nodes only, vectorized for multiple destinations; custom nodes generate traffic in run())

  5. addMobility (optional)

  6. Instrumentation — event tracer, IQ logger, traffic viewer (optional)

  7. addNodes(sim, nodes) (batch, one call per technology type)

  8. run(sim, duration) or multi-step with IsLastStep=false

  9. statistics() or technology-specific KPI functions

Simulator Initialization

wirelessNetworkSimulator.init MUST be the first executable statement. The simulator is a singleton — calling .init reinitializes it. Never use a constructor (wirelessNetworkSimulator() — doesn't exist).

clearvars;
rng("default");
sim = wirelessNetworkSimulator.init;

Custom Node (wnet.Node Subclass)

Override 5 methods: run, pullTransmittedPacket, pushReceivedPacket, isPacketRelevant, statistics. Always use pkt = wirelessPacket to create packet structures — this initializes all required fields including Metadata.Channel (needed by the channel model). Use wnet.TechnologyType.Custom1–Custom9 for the TechnologyType field. See references/custom-node.md for the full method table, packet fields, receive buffering pattern, and example.

Access specifiers: All overridden methods must match the parent wnet.Node access specifier. In R2026a, run, pullTransmittedPacket, pushReceivedPacket, isPacketRelevant, and statistics are all public in wnet.Node. Place them in a single methods block (default public) alongside the constructor. Using a different access specifier (e.g., protected) causes a MATLAB error.

Critical: run() must guard transmissions with NextTxTime and round(..., 9) — the simulator re-invokes run() at the same currentTime after delivering received packets. Without the guard, 2+ nodes cause an infinite loop.

Troubleshooting: If encountering errors with custom node creation, refer to the built-in example for a working implementation: openExample("wnet/CreateAndSimulateWirelessNetworkOfCustomNodesExample"). Inspect the custom node class code for correct method signatures and access specifiers.

Vectorized Node Creation

Any supported node type can create multiple nodes with Position=[N×3] and Name=[1×N string]:

nodes = NodeConstructor(Position=[5 0 0; 0 5 0; -5 0 0], Name=["N1", "N2", "N3"]);
Random Placement with nodePositionRandom
region = nsidedpoly(6, Center=[0 0], SideLength=50);
positions = nodePositionRandom(region, NumNodes=10, ZCoordinate=0);
nodes = NodeConstructor(Position=positions, Name="N"+(1:10));

Batch addNodes

One addNodes per technology type. Never call per-node.

addNodes(sim, [sourceNode; destNodes(:)]);    % same type
addNodes(sim, nodesTypeA);                     % mixed sim: separate calls
addNodes(sim, nodesTypeB);

Traffic Sources

addTrafficSource is available only on technology nodes (BLE, BR/EDR, WLAN, NR) — not on custom wnet.Node subclasses.

networkTrafficOnOff DataRate is in Kbps (kilobits/s). The generate() method returns inter-packet time in ms.

traffic = networkTrafficOnOff(DataRate=100, PacketSize=50, OnTime=Inf);

Common mistake: DataRate=100000 for 100 Kbps — this is 100 Mbps (1000× too high). Runs without error but produces unrealistic traffic. See references/traffic-models.md for all traffic source types and their parameters.

Reuse a single traffic object for identical flows — DestinationNode accepts vectors:

addTrafficSource(central, traffic, DestinationNode=[p1; p2; p3]);

Vectorized Statistics

For technology nodes (BLE, BR/EDR, WLAN, NR), vectorized statistics returns a 1×N struct array:

allStats = statistics(nodes);  % 1×N struct array (technology nodes)
rxBytes = [allStats.App];      % Concatenate sub-structs

For custom wnet.Node subclasses, vectorized behavior depends on the statistics() method implementation — call per-node if the return struct varies.

Mobility

addMobility on the node vector directly (not per-node). Bounds = [x_center, y_center, width, height] (NOT [xmin, ymin, xmax, ymax]).

addMobility(nodes, MobilityModel="random-waypoint", SpeedRange=[1.0 1.5], Bounds=[10 0 12 4]);

Models: "random-waypoint", "random-walk", "constant-velocity". Every node must be within ±width/2 of x_center and ±height/2 of y_center. See references/mobility-models.md for detailed examples.

Multi-Step Simulation

Each run specifies additional duration (relative), not absolute end time:

run(sim, 0.3, IsLastStep=false);   % Run 0.3s, keep state
stats_mid = statistics(node);
run(sim, 0.2);                      % Additional 0.2s (0.5s total)

Scheduled Actions

scheduleAction(sim, @myCallback, userData, 0.3);         % one-shot at t=0.3s
scheduleAction(sim, @myCallback, userData, 0.1, 0.05);   % periodic: start 0.1s, repeat 0.05s

Callback signature — two arguments (actionID, userData):

function myCallback(actionID, userData)
    stats = statistics(userData.node);
end

Valid mid-sim operations: statistics(node), change node.Position, technology-specific mid-sim methods. Most RF properties are locked after run() starts.

Custom Channel Model

addChannelModel(sim, @myChannelModel);

function txData = myChannelModel(rxInfo, txData)
    dist = norm(rxInfo.Position - txData.TransmitterPosition);
    fspl = 20*log10(dist) + 20*log10(txData.CenterFrequency) - 147.55;
    txData.Metadata.Channel.PathDelays = 0;
    txData.Metadata.Channel.PathGains = -fspl;
end

Signature: function txData = fcn(rxInfo, txData) — two inputs, not one.

rxInfo fields: ID, Position, Velocity, NumReceiveAntennas.

Key txData fields: Power, CenterFrequency, StartTime, TransmitterPosition, TransmitterVelocity, Bandwidth, Metadata.Channel (PathGains, PathDelays, PathFilters, SampleTimes).

Default uses FSPL. Use addChannelModel for distance-dependent fading, multipath, or environment-specific propagation.

Parametric Sweeps

wirelessNetworkSimulator.init MUST be at the top of every loop iteration (singleton retains state). See references/parametric-sweep-pattern.md for multi-dim and parfor patterns.

Instrumentation (R2026a)

All tools must be created before run(). See references/event-tracing-iq-logging.md for full details.

eventTracer = wirelessNetworkEventTracer(FileName="events.mat");
addNodes(eventTracer, nodes, EventName=["TransmissionStarted", "ReceptionEnded"]);

iqLogger = wirelessIQLogger(receiverNodes, FileName="iq_samples.mat");

viewer = wirelessTrafficViewer;
addNodes(viewer, nodes);
  • Event Tracer: Works with all node types. addNodes calls registerEventCallback on each node for each specified EventName — for custom wnet.Node subclasses, your node must override registerEventCallback to support the event names (see references/custom-node.md). Errors if MAT file already exists. Read with read(eventTracer, EventName=..., NodeName=..., TimeRange=...).

  • IQ Logger: Nodes fixed at construction (no addNodes). ~4–5 MB per node per 0.1s at 80 MHz. Technology nodes only — custom wnet.Node subclasses are not supported.

  • Network Viewer: wirelessNetworkViewer(NetworkSimulator=sim) + addNodes(viewer, nodes, Type="Transmitter"/"Receiver") + showBoundary(viewer, BoundaryShape="circle", Bounds=radius, Position=[x y z]). Shapes: "circle", "rectangle", "hexagon".

  • Traffic Viewer: Real-time state transitions and channel occupancy. Technology nodes only — custom wnet.Node subclasses are not supported.

PCAP Capture

Generic pcapWriter for any technology; technology-specific writers (blePCAPWriter, wlanPCAPWriter, nrPCAPWriter) auto-capture from nodes via Node= property.

% Generic (manual write)
pcapObj = pcapWriter(FileName="my_capture");
writeGlobalHeader(pcapObj, linkType);
write(pcapObj, packetBytes, round(simTime * 1e6));  % timestamp in microseconds (integer)

% Technology-specific (auto-capture, no write calls needed)
blePcap = blePCAPWriter(FileName="ble_capture", Node=[central; peripheral]);

Common link types: LINKTYPE_USER0 (147), LINKTYPE_IEEE802_11 (105). Reading: readAll(pcapReader("file.pcap")).

For Bluetooth-specific PCAP capture, see references/bluetooth-capture.md.

Event Callbacks (registerEventCallback)

Register a callback on a node to be invoked when a specific event occurs. Callback receives a single argument (event data struct).

registerEventCallback(node, "ReceptionEnded", @myCallback);

function myCallback(eventData)
    disp(eventData.Timestamp);          % sim time (seconds)
    disp(eventData.EventData.SINR);     % technology-specific nested payload
end

Technology nodes (BLE, BR/EDR, WLAN, NR): Call registerEventCallback to register — the node's internal implementation automatically invokes the callback at the correct moments during simulation.

Custom wnet.Node subclasses: The base wnet.Node.registerEventCallback is a no-op stub — it accepts arguments but does not store or fire callbacks. You MUST override registerEventCallback in your subclass to store callbacks, then explicitly invoke them at the appropriate points (e.g., after transmitting in run(), after receiving in pushReceivedPacket()). See references/custom-node.md for the full implementation pattern.

Top-level fields: EventName, NodeName, NodeID, Timestamp, TechnologyType, EventData (nested struct).

For Bluetooth-specific event data fields, see references/bluetooth-capture.md.

Common Mistakes

MistakeCorrect
node = wnet.Node(...) or creating a bare wnet.Nodewnet.Node is abstract — subclass it: classdef MyNode < wnet.Node
Using bluetoothLENode/bluetoothNode for non-Bluetooth scenariosUse a custom wnet.Node subclass for generic/custom wireless nodes
TechnologyType = "custom" (string)Use wnet.TechnologyType.Custom1 (numeric constant 101–109)
Bounds=[0 0 20 20] as [xmin,ymin,xmax,ymax]Bounds=[x_center, y_center, width, height]
function myFcn(userData) for scheduleActionfunction myFcn(actionID, userData) — 2 args
function txData = fcn(txData) for addChannelModelfunction txData = fcn(rxInfo, txData) — 2 inputs
addMobility(sim, nodes, ...)addMobility(nodes, ...) — node method, not sim
DataRate=100000 for 100 KbpsDataRate=100 — unit is Kbps
pcapWriter() without writeGlobalHeaderMust call writeGlobalHeader(pcapObj, linkType) before any write()
Building file-write callbacks for loggingUse wirelessNetworkEventTracer instead
Calling registerEventCallback on a custom node without overriding itBase wnet.Node.registerEventCallback is a no-op — override it to store callbacks, fire them manually from run()/pushReceivedPacket()
addTrafficSource(customNode, traffic, ...) on a custom wnet.NodeaddTrafficSource is technology-node-only
Ignoring received packets in pushReceivedPacketUse wnet.internal.interferenceBuffer with addPacket to store received packets

<!-- Copyright 2026 The MathWorks, Inc. -->

Files

references/custom-node.md

Custom Node (wnet.Node Subclass)

Any node that is not a specific technology (Bluetooth, WLAN, 5G NR) must be implemented as a custom wnet.Node subclass. Technology-specific nodes (bluetoothLENode, bluetoothNode, wlanNode, nrGNB, nrUE) also inherit from wnet.Node — they implement the same method contracts internally. Information in this reference about wnet.Node properties (Position, ID, Name, Velocity, Mobility), addMobility, registerEventCallback, and statistics applies to all nodes regardless of technology.

Never instantiate wnet.Node directly — it is an abstract base class. Always subclass it.

Override these methods:

MethodSignatureContract
runnextInvokeTime = run(obj, currentTime)Return nextInvokeTime > currentTime unless the node intentionally needs to run again at the same time (e.g., to process a received packet or trigger another operation). Returning nextInvokeTime == currentTime without a termination condition causes an infinite loop.
pullTransmittedPacketpacket = pullTransmittedPacket(obj)Return struct array or []
pushReceivedPacketpushReceivedPacket(obj, packet)Buffer received packet (no return)
isPacketRelevant[flag, rxInfo] = isPacketRelevant(obj, packet)Return flag (logical) and rxInfo struct
statisticsstats = statistics(obj)Return struct with node stats

Re-invocation rule: The simulator calls run() again at the same currentTime after delivering a received packet. If run() unconditionally transmits, this creates an infinite Tx→Rx→Tx loop between nodes. Fix: Track NextTxTime and only transmit when currentTime >= round(obj.NextTxTime, 9). Store with round(currentTime + interval, 9) — the simulator uses nanosecond precision, so floating-point comparisons without rounding cause spurious re-transmissions. Return nextInvokeTime = obj.NextTxTime so re-invocations at the same time are no-ops.

Packet Structure (wirelessPacket)

pullTransmittedPacket must return a structure (or struct array) conforming to the wirelessPacket format. Use wirelessPacket to create an empty template:

pkt = wirelessPacket;   % Returns struct with all required fields initialized to defaults
FieldTypeDescription
TechnologyTypewnet.TechnologyType constantUse wnet.TechnologyType.Custom1 through Custom9 for custom nodes. Technology nodes use wnet.TechnologyType.BluetoothLE (3), .BluetoothBREDR (4), .WLAN (1), .NR5G (2).
DirectToDestinationnumeric0 = through channel model; nonzero = destination node ID (bypasses channel)
TransmitterIDpositive integerSource node ID (obj.ID)
TransmitterPosition1x3 doubleobj.Position
TransmitterVelocity1x3 doubleobj.Velocity or [0 0 0] if stationary
NumTransmitAntennaspositive integerNumber of Tx antennas
StartTimenonneg scalarPacket start time (seconds)
Durationpositive scalarPacket duration (seconds)
PowerscalarTransmit power (dBm)
CenterFrequencypositive scalarCenter frequency (Hz)
Bandwidthpositive scalarBandwidth (Hz)
Abstractionlogicaltrue = abstracted PHY, false = full waveform
SampleRatepositive scalarSample rate (samples/s); required when Abstraction=false
DatavariesPayload: uint8 array for abstracted PHY, T×R complex matrix for full PHY
Metadata.Channelstructstruct('PathGains',[],'PathDelays',[],'PathFilters',[],'SampleTimes',[]) — populated by channel model
Tagsstruct arrayOptional. Each element has fields: Name (string), Value (data), ByteRange (byte range in packet)

Required rxInfo Fields

Returned by isPacketRelevant:

FieldType
IDpositive integer (receiver node ID)
Position1x3 double (receiver position)
NumReceiveAntennaspositive integer

Storing Received Packets

The simulator calls pushReceivedPacket(obj, packet) to deliver packets that passed the isPacketRelevant check. The packet argument is a wirelessPacket structure (same format as transmitted packets, but with Metadata.Channel populated by the channel model).

Use wnet.internal.interferenceBuffer to store received packets. Create one in the constructor and push packets with addPacket:

properties (Access = private)
    InterfBuffer    % wnet.internal.interferenceBuffer
    RxCount = 0
end
methods
    function obj = MyNode(nvargs)
        % ... set Position, Name ...
        obj.InterfBuffer = wnet.internal.interferenceBuffer( ...
            CenterFrequency=2.4e9, Bandwidth=1e6, Abstraction=true);
    end
    function pushReceivedPacket(obj, packet)
        addPacket(obj.InterfBuffer, packet);
        obj.RxCount = obj.RxCount + 1;
    end
end

The interference buffer provides methods to query stored packets:

MethodDescription
addPacket(buf, packet)Add a wirelessPacket struct; returns buffer index
packetList(buf, startTime, endTime)Return packets overlapping the time range
receivedPacketPower(buf, startTime)Total power (dBm) of packets on the channel
retrievePacket(buf, bufferIdx)Retrieve packet by buffer index
removePacket(buf, bufferIdx)Remove packet by buffer index
bufferChangeTime(buf, currentTime)Time until next buffer state change

Access Specifiers

When overriding inherited methods from wnet.Node, you must use the same access specifier as the parent class. In R2026a, all five required methods (run, pullTransmittedPacket, pushReceivedPacket, isPacketRelevant, statistics) are declared with Access = public in wnet.Node. Your subclass must place them in a methods block (default public). Using methods (Access = protected) or methods (Access = private) will cause a MATLAB error:

Error: Method 'run' in class 'MyNode' uses different access permissions than its superclass 'wnet.Node'.

Tip: If unsure about access specifiers, inspect the parent class metadata:

m = ?wnet.Node;
for i = 1:numel(m.MethodList)
    fprintf("%s: Access=%s\n", m.MethodList(i).Name, m.MethodList(i).Access);
end

Event Callbacks for Custom Nodes

The base wnet.Node.registerEventCallback is a no-op stub — it accepts arguments but does not store or fire callbacks. For custom nodes that need event callbacks (e.g., for PCAP capture, logging, or external instrumentation), you must:

  1. Override registerEventCallback to store the callback and event name

  2. Fire callbacks manually at the appropriate points in your node logic

When to fire each event
EventFire fromTiming
TransmissionStartedrun()After buffering the packet
ReceptionEndedpushReceivedPacket()After storing the received packet

The callback receives a single eventData struct with fields: EventName, NodeName, NodeID, Timestamp, TechnologyType, EventData (nested struct with packet payload in Data).

Troubleshooting

If you encounter errors when creating a custom wnet.Node subclass, open the built-in example to inspect a working implementation:

openExample("wnet/CreateAndSimulateWirelessNetworkOfCustomNodesExample")

Review the custom node class file in the example for correct method signatures, access specifiers, and property declarations.

Example

classdef MyNode < wnet.Node
    properties (Access = private)
        TxBuffer = []
        InterfBuffer
        RxCount = 0
        TxInterval = 0.01
        NextTxTime = 0
        EventCallbacks = struct('EventName', {}, 'Callback', {})
    end
    methods
        function obj = MyNode(nvargs)
            arguments
                nvargs.Position (1,3) double = [0 0 0]
                nvargs.Name string = "MyNode"
            end
            obj.Position = nvargs.Position;
            obj.Name = nvargs.Name;
            obj.InterfBuffer = wnet.internal.interferenceBuffer( ...
                CenterFrequency=2.4e9, Bandwidth=1e6, Abstraction=true);
        end
        function registerEventCallback(obj, eventName, callback)
            eventName = string(eventName);
            for k = 1:numel(eventName)
                idx = numel(obj.EventCallbacks) + 1;
                obj.EventCallbacks(idx).EventName = eventName(k);
                obj.EventCallbacks(idx).Callback = callback;
            end
        end
        function nextInvokeTime = run(obj, currentTime)
            if currentTime >= round(obj.NextTxTime, 9)
                pkt = wirelessPacket;
                pkt.TechnologyType = wnet.TechnologyType.Custom1;
                pkt.DirectToDestination = 0;
                pkt.TransmitterID = obj.ID;
                pkt.TransmitterPosition = obj.Position;
                pkt.TransmitterVelocity = obj.Velocity;
                pkt.NumTransmitAntennas = 1;
                pkt.StartTime = currentTime;
                pkt.Duration = 0.001;
                pkt.Power = 0;
                pkt.CenterFrequency = 2.4e9;
                pkt.Bandwidth = 1e6;
                pkt.Abstraction = true;
                pkt.SampleRate = 1e6;
                pkt.Data = randi([0 255], 1, 50, 'uint8');
                obj.TxBuffer = [obj.TxBuffer pkt];
                obj.NextTxTime = round(currentTime + obj.TxInterval, 9);
                obj.fireEvent("TransmissionStarted", currentTime, pkt);
            end
            nextInvokeTime = obj.NextTxTime;
        end
        function packet = pullTransmittedPacket(obj)
            packet = obj.TxBuffer;
            obj.TxBuffer = [];
        end
        function pushReceivedPacket(obj, packet)
            addPacket(obj.InterfBuffer, packet);
            obj.RxCount = obj.RxCount + 1;
            obj.fireEvent("ReceptionEnded", packet.StartTime + packet.Duration, packet);
        end
        function [flag, rxInfo] = isPacketRelevant(obj, packet)
            flag = (packet.TransmitterID ~= obj.ID);
            rxInfo = struct('ID', obj.ID, 'Position', obj.Position, 'NumReceiveAntennas', 1);
        end
        function stats = statistics(obj, varargin)
            stats.RxCount = obj.RxCount;
        end
    end
    methods (Access = private)
        function fireEvent(obj, eventName, timestamp, pkt)
            for i = 1:numel(obj.EventCallbacks)
                if obj.EventCallbacks(i).EventName == eventName
                    eventData = struct( ...
                        'EventName', eventName, ...
                        'NodeName', obj.Name, ...
                        'NodeID', obj.ID, ...
                        'Timestamp', timestamp, ...
                        'TechnologyType', 'Custom1', ...
                        'EventData', struct('Data', pkt.Data));
                    obj.EventCallbacks(i).Callback(eventData);
                end
            end
        end
    end
end

<!-- Copyright 2026 The MathWorks, Inc. -->

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

The author says: >=R2026a

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
MathWorks
Publisher
MathWorks (Official)
Source
matlab/matlab-agentic-toolkit · skills-catalog/wireless-communications/matlab-simulate-wireless-network · commit 2a7f215
Licence
BSD 2-Clause License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by MathWorks.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download matlab-simulate-wireless-network.zip