Main Content

setName

Set name for port

    Description

    example

    setName(port,name) sets the name for the designated port.

    Examples

    collapse all

    Create a model, get the root architecture, add a component, add a port, and set a new name for the port.

    model = systemcomposer.createModel('archModel');
    rootArch = get(model,'Architecture');
    newcomponent = addComponent(rootArch,'NewComponent');
    newport = addPort(newcomponent.Architecture,'NewCompPort','in');
    setName(newport,'CompPort');

    Input Arguments

    collapse all

    Port to be renamed, specified as a systemcomposer.arch.ArchitecturePort or systemcomposer.arch.ComponentPort object.

    Name of port, specified as a character vector.

    Data Types: char

    Introduced in R2019a