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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 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)