nodePositionRandom
Syntax
Description
The nodePositionRandom function randomly generates node positions
within a specified region. You can define this region using a boundary shape and dimensions, a
given polygon, or the intersection of two boundaries. This function enables you distribute
serving nodes, such as next generation NodeB (gNB), access points (AP), or Central nodes,
across a broad area. At the same time, it restricts served nodes, such as user equipment (UE)
nodes, Station nodes, or Peripheral nodes, to the intersection of coverage zones. For more
information about how to simulate this scenario, see the Randomly Place Wireless Nodes in Polygon and Visualize Placement example.
Generate Random Node Positions within Specified Boundary Shape and Dimensions
[
generates a single random position within the specified boundary shape and dimensions.
nodePosition,polygonShapeOut] = nodePositionRandom(boundaryShape,boundaryDimension)
[
specifies the node position configuration parameters using one or more optional name-value
arguments. nodePosition,polygonShapeOut] = nodePositionRandom(boundaryShape,boundaryDimension,Name=Value)
Generate Random Node Positions within Specified Polygon
[
generates a single random node position within the specified polygon
nodePosition,polygonShapeOut] = nodePositionRandom(polygonShapeIn)polygonShapeIn.
[
specifies the node position configuration parameters using one or more optional name-value
arguments. Note that the nodePosition,polygonShapeOut] = nodePositionRandom(polygonShapeIn,Name=Value)Center name-value argument does not apply
when you use this syntax.
Generate Random Node Positions within Boundary Intersections
[
specifies the parent boundary details nodePosition,polygonShapeOut] = nodePositionRandom(polygonShapeIn,boundaryShape,boundaryDimension)polygonShapeIn. The function
considers two boundaries, one from the parent boundary and another defined by the
boundaryShape and boundaryDimension arguments,
and generates a single random node position exclusively in the area where these two
boundaries intersect. Note that the output argument polygonShapeOut
is a polyshape
object representing the intersection of the parent boundary
polygonShapeIn and the boundary defined by
boundaryShape and boundaryDimension.
[
specifies the node position configuration parameters using one or more optional name-value
arguments. For example, nodePosition,polygonShapeOut] = nodePositionRandom(polygonShapeIn,boundaryShape,boundaryDimension,Name=Value)ZCoordinate=3.5 sets the
z-coordinate of all node positions to 3.5 meters.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Version History
Introduced in R2026a


