主要内容

hideBoundary

Remove placement boundaries from canvas

Since R2026a

    Description

    hideBoundary(networkViewer) removes all the placement boundaries from the canvas.

    example

    hideBoundary(networkViewer,Name=name) removes the placement boundary with the specified name name, from the canvas.

    Examples

    collapse all

    Generate and visualize the random placement of wireless nodes within a rectangular area. Using the nodePositionRandom function, you distribute ten nodes uniformly inside a 100-by-100 meter region. Then, a wirelessNetworkViewer object displays the resulting node positions.

    Set the area dimensions and number of nodes.

    areaLength = 100;           % Rectangle length (meters)
    areaWidth = 100;            % Rectangle width (meters)
    numNodes = 10;              % Number of random nodes

    Generate random node positions in the rectangle.

    [nodePositions,rectPoly] = nodePositionRandom( ...
        "rectangle",[areaLength areaWidth],NumNodes=numNodes);

    View the positions using the wireless network viewer.

    viewer = wirelessNetworkViewer(CanvasSize=[200 200]);
    addNodes(viewer,nodePositions,Type="RandomNodePositions")

    Show the rectangle boundary.

    showBoundary(viewer, ...
        Position=[0 0 0], ...
        BoundaryShape="rectangle", ...
        Bounds=[areaLength areaWidth], ...
        Name="RectangleBoundary")

    Figure Wireless Network Viewer contains an axes object. The axes object with xlabel X-axis (m), ylabel Y-axis (m) contains 22 objects of type line. One or more of the lines displays its values using only markers These objects represent Canvas Boundary, RandomNodePositions, Boundary.

    Remove the node position by uncommenting this line of code.

    % removeNodes(viewer)

    Hide the rectangle boundary by uncommenting this line of code.

    % hideBoundary(viewer)

    Input Arguments

    collapse all

    Wireless network viewer, specified as a wirelessNetworkViewer object.

    Name of boundary to delete, specified as a string scalar, a vector of strings, or a character vector. Each string must be unique. When you do not specify this argument, the function removes all the boundaries from the canvas.

    Data Types: string | char

    Version History

    Introduced in R2026a