Main Content

setInterface

Set interface for port

    Description

    example

    setInterface(port,interface) sets the interface for a port.

    Examples

    collapse all

    Create a model, get the root architecture, add a component, add a port, add an interface, and set the interface for the port.

    model = systemcomposer.createModel('archModel');
    rootArch = get(model,'Architecture');
    newcomponent = addComponent(rootArch,'NewComponent');
    newport = addPort(newcomponent.Architecture,'NewCompPort','in');
    newinterface = addInterface(model.InterfaceDictionary,'NewInterface');
    setInterface(newport,newinterface);

    Input Arguments

    collapse all

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

    Interface to set, specified as a systemcomposer.interface.SignalInterface object.

    Introduced in R2019a