registerEventCallback
Description
Examples
This example demonstrates how to register callback functions for key events in a 5G network simulation
To ensure simulation results are repeatable, initialize the random number generator with a fixed seed. For greater statistical accuracy, run the simulation with different seeds and compute the average results.
rng("default")Create a wireless network simulator object. Specify the simulation time in seconds.
networkSimulator = wirelessNetworkSimulator.init; simulationTime = 0.3;
Create and configure a base station (gNB).
gnb = nrGNB;
Create and configure a user equipment node.
ue = nrUE;
Add a mobility model to the UE node.
addMobility(ue)
Establish a connection between the gNB node and the UE node.
connectUE(gnb,ue)
Create a network On-Off application traffic pattern object.
traffic = networkTrafficOnOff;
Add the data traffic source to the gNB node. Set the destination node as the UE node.
addTrafficSource(gnb,traffic,DestinationNode=ue)
Add the gNB node to the wireless network simulator.
addNodes(networkSimulator,gnb)
Add the UE node to the wireless network simulator.
addNodes(networkSimulator,ue)
Register for the "TransmissionStarted", "ReceptionEnded", "AppPacketGenerated", and "AppPacketReceived" events from the gNB node.
registerEventCallback(gnb,["TransmissionStarted" "ReceptionEnded" "AppPacketGenerated" "AppPacketReceived"],@(eventStruct) disp(eventStruct));
.Register for the "TransmissionStarted", "ReceptionEnded", "AppPacketGenerated", and "AppPacketReceived" events from the UE node.
registerEventCallback(ue,["TransmissionStarted" "ReceptionEnded" "AppPacketGenerated" "AppPacketReceived"],@(eventStruct) disp(eventStruct));
Run the simulation for the specified time.
run(networkSimulator,simulationTime)
EventName: "AppPacketGenerated"
NodeName: "Node1"
NodeID: 1
Timestamp: 0
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 1.0000e-03
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 1.0000e-03
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 1.0000e-03
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0020
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0020
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0030
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0030
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0040
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0040
TechnologyType: 2
EventData: [1×1 struct]
EventName: "AppPacketReceived"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0050
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0050
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0050
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0060
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0150
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0160
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0250
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0260
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0350
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0360
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0450
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0460
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0550
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0560
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0650
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0660
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0750
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0760
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0850
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0860
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.0950
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.0960
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1000
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1000
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1010
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1010
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1050
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1060
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1150
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1160
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1250
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1260
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1350
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1360
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1450
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1460
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1550
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1560
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1650
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1660
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1750
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1760
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1850
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1860
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.1950
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.1960
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2000
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2000
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2010
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2010
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2050
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2060
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2100
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2110
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2150
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2160
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2200
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2210
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2250
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2260
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2300
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2310
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2350
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2360
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2400
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2410
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2450
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2460
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2500
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2510
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2550
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2560
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2600
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2610
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2650
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2660
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2700
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2710
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2750
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2760
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2800
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2810
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2850
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2860
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2900
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2910
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.2950
TechnologyType: 2
EventData: [1×1 struct]
EventName: "ReceptionEnded"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.2960
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node1"
NodeID: 1
Timestamp: 0.3000
TechnologyType: 2
EventData: [1×1 struct]
EventName: "TransmissionStarted"
NodeName: "Node2"
NodeID: 2
Timestamp: 0.3000
TechnologyType: 2
EventData: [1×1 struct]
Input Arguments
NR node object, specified as an nrGNB object, an
nrUE object, a vector of nrGNB objects or a vector
of nrUE objects.
Name of the event, specified as a string scalar, character vector, vector of strings, or cell array of character vectors. Each element of this input argument must be one of these values:
"TransmissionStarted""ReceptionEnded""AppPacketGenerated""AppPacketReceived"
For more information about these events, see Events and corresponding event notification data substructure.
Callback function to run when the NR node notifies the occurrence of the event, specified as a scalar function handle. The callback function must use this syntax.
@(eventStruct) callback(eventStruct)
eventStruct with the notification data as
a mandatory argument to this input.
| Field | Value | Description |
|---|---|---|
| String scalar | Name of the event |
| String scalar | Name of the node |
| Double scalar | Node identifier |
| Double scalar | Time at which the event is notified, in seconds |
| Double scalar | Type of technology specified as one of these values
|
| Structure | Event notification data For more information about this structure, see More About. |
Note
Register a callback function for an event from nrGNB and
nrUE only
once. If you register the same callback function multiple times for the same event,
the callback function executes repeatedly each time the node notifies the
event.
More About
The object function triggers these events.
TransmissionStartedThe physical layer (PHY) triggers this event, notifying the start of packet transmission. The node passes this structure as event data to the registered callback.
| Field | Value | Description |
|---|---|---|
PDU |
Column vector of decimal octets | MAC protocol data units (PDUs) in current transmission |
Length |
| Number of octets sent from the MAC layer to the physical layer (PHY) |
Duration | Double scalar | Over the air transmission time in seconds, including PHY overhead. |
TransmitPower | Double scalar | Power of the current transmission, in dBm |
| Center Frequency | Double scalar | Frequency of operation of the PHY, in Hz. |
| Bandwidth | Double scalar | Bandwidth of operation of the PHY, in Hz. |
RNTI |
| The radio network temporary identifier (RNTI) identifies the user equipment (UE) that transmits the protocol data unit (PDU) in the uplink, or the UE to which the PDU is transmitted in the downlink. |
DuplexMode |
| Duplex mode determines how the system separates uplink and downlink transmissions. |
FrameInfo | A 3-element vector of nonnegative integers. | Timing information. Vector of three elements represented as [NFrame NSlot NSymbol], where:
Note NFrame can be greater than 1023. The user should apply a modulo 1024 operation when using it.
|
LinkDirection |
| Link direction |
HARQID |
| The hybrid automatic repeat request (HARQ) process identifier associated with the transmission. |
SignalType |
| This value indicates whether the given transmission or reception is for control only, data only, or both. Note If |
IsRetransmission |
| This flag indicates whether the transmission is new or a retransmission. |
MeasurementSignalRNTI |
This field applies to the downlink direction. | The RNTI values identifying the UEs that receive the channel measurement signal. |
ReceptionEndedThe PHY layer triggers this event, notifying the end of packet reception at PHY. The node passes this structure as event data to the registered callback.
| Field | Value | Description |
|---|---|---|
PDU |
Column vector of decimal octets | List of MAC-PDUs in current reception. |
RNTI |
| The RNTI identifies the UE that receives the PDU in the downlink, or the UE from which the PDU is received in the uplink. |
Length |
| Number of octets sent from the PHY to the MAC. |
Duration
| Double scalar | Duration of the current reception, in seconds. |
CenterFrequency | Double scalar | Frequency of operation of the PHY, in Hz. |
Bandwidth | Double scalar | Bandwidth of operation of the PHY, in Hz. |
PHYDecodeStatus |
| Decoding status of the current reception at the PHY. |
DuplexMode |
| Duplex mode determines how the system separates uplink and downlink transmissions. |
FrameInfo | A 3-element vector of nonnegative integers. | Timing information. Vector of three elements represented as [NFrame NSlot NSymbol], where:
|
LinkDirection |
| Link direction |
SINR |
| The Signal-to-interference-plus-noise ratio (SINR) in dB for the current reception. |
HARQID |
| The HARQ process identifier associated with the reception. |
SignalType |
| This value indicates whether the given transmission or reception is for control only, data only, or both. |
AppPacketGeneratedThe application layer triggers this event, notifying when traffic manager transmits a packet. The node passes this structure as event data to the registered callback.
| Field | Value | Description |
|---|---|---|
Packet | Column vector of decimal octets | Application packet in bytes. |
PacketLength | Double scalar | Number of bytes in the application packet. |
DestinationNodeID | Double scalar | Identifier of the destination node. |
LogicalChannelID | Positive integer | Logical channel identifier (ID) for the transmitted packet. |
Note
If you generate packets using full-buffer traffic, the node does not notify this event.
AppPacketReceivedThe application layer triggers this event, notifying when traffic manager receives a packet. The node passes this structure as event data to the registered callback.
| Field | Value | Description |
|---|---|---|
Packet | Column vector of decimal octets | Application packet in bytes. |
PacketLength | Double scalar | Number of bytes in the application packet. |
SourceNodeID | Double scalar | Identifier of the source node. |
LogicalChannelID | Positive integer | Logical channel identifier for the received packet. |
Note
The node does not notify this event when it receives packets generated using full-buffer traffic.
Version History
Introduced in R2026a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)