addNodes
Description
addNodes(
adds wireless nodes to the wireless traffic viewer object,
wirelessTrafficVis,node)wirelessTrafficVis.
Examples
Initialize a wireless network simulator, then create and configure both an access point (AP) node and a station (STA) node. After associating the STA with the AP, you add both nodes to the simulation. Next, you set up a wireless traffic viewer for visualization and run the simulation to observe the state transitions and channel occupancy of the wireless nodes.
Initialize the wireless network simulator.
networkSimulator = wirelessNetworkSimulator.init;
Create and configure the AP node.
deviceCfg = wlanDeviceConfig(Mode="AP"); apNode = wlanNode(Name="AP",Position=[0 10 0],DeviceConfig=deviceCfg);
Create the STA node with a default device configuration.
staNode = wlanNode(Name="STA",Position=[5 0 0]);Associate the STA node with the AP node.
associateStations(apNode,staNode,FullBufferTraffic="on")Add the nodes to the simulator.
addNodes(networkSimulator,[apNode staNode])
Create a wireless traffic viewer and add the nodes to it.
wirelessTrafficVis = wirelessTrafficViewer; addNodes(wirelessTrafficVis,[apNode staNode])
Set the simulation time, and run the simulation.
simulationTime = 0.2; run(networkSimulator,simulationTime)

Try exploring these additional features of the wireless traffic viewer:
Disable and enable nodes from plots.
Disable and enable operating states and node types.
Visualize certain time and frequency durations.
Export images.
Simulate a Bluetooth® Low Energy (LE) network to observe the state transitions and channel occupancy of Bluetooth nodes. Initialize the wireless network simulator, create and connect a Central and a Peripheral node, and configure On-Off traffic. After adding the nodes to the simulator and the wireless traffic viewer, run the simulation and visualize node activity.
Initialize the wireless network simulator.
networkSimulator = wirelessNetworkSimulator.init;
Set simulation time.
simulationTime = 0.2;
Create a Central and PeripheralBluetooth LE node.
centralNode = bluetoothLENode("central",Position=[0 0 0]); peripheralNode = bluetoothLENode("peripheral",Position=[1 0 0]);
Create and configure the connection between the nodes.
cfg = bluetoothLEConnectionConfig; configureConnection(cfg,centralNode,peripheralNode);
Configure On-Off traffic.
traffic = networkTrafficOnOff(DataRate=200,PacketSize=27,OnTime=Inf,OffTime=0);
Add traffic sources.
addTrafficSource(centralNode,traffic,DestinationNode=peripheralNode)
Add the nodes to the simulator.
nodes = [centralNode peripheralNode]; addNodes(networkSimulator,nodes)
Create a wireless traffic viewer and add the nodes to it.
wirelessTrafficVis = wirelessTrafficViewer; addNodes(wirelessTrafficVis,nodes)
Run the simulation.
run(networkSimulator,simulationTime)

Try exploring these additional features of the wireless traffic viewer:
Disable and enable nodes from plots.
Disable and enable operating states and node types.
Visualize certain time and frequency durations.
Export images.
Input Arguments
Wireless traffic viewer, specified as a wirelessTrafficViewer
object.
Wireless node, specified as an object of a subclass of wnet.Node, a
vector of objects of subclass of wnet.Node, or a cell array of objects of
subclass of wnet.Node.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)