Main Content

registerEventCallback

Register callback for event from 5G node

Since R2026a

    Description

    registerEventCallback(nrNode,eventName,callback) registers the function callback, callback, for the specified event eventName from the new radio (NR) node nrNode.

    example

    Examples

    collapse all

    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

    collapse all

    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)
    The NR node passes the event structure eventStruct with the notification data as a mandatory argument to this input.

    Field ValueDescription

    EventName

    String scalar

    Name of the event

    NodeName

    String scalar

    Name of the node

    NodeID

    Double scalar

    Node identifier

    Timestamp

    Double scalar

    Time at which the event is notified, in seconds

    TechnologyType

    Double scalar

    Type of technology specified as one of these values

    • 0 — Invalid

    • 1 — WLAN

    • 2 — 5G

    • 3 — Bluetooth LE

    • 4 — Bluetooth basic rate/enhanced data rate ( BR/EDR)

    EventData

    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

    collapse all

    Version History

    Introduced in R2026a

    See Also

    Objects