主要内容

addInput

Create new inputs on adapter

Since R2026a

    Description

    ports = addInput(adapter,inputNames) creates and adds new inputs on the adapter specified by adapter according to the input names specified by inputNames and returns the corresponding port objects in ports.

    example

    Examples

    collapse all

    Create an adapter with ports in System Composer™.

    Create a model and get the root architecture.

    model = systemcomposer.createModel("archModel");
    systemcomposer.openModel("archModel");
    rootArch = get(model,"Architecture");

    Create an adapter.

    adapter = rootArch.addAdapter(InputName=["p1"],OutputName=["p3"]);

    Add an input port to the adapter.

    adapter.addInput("p2");

    Input Arguments

    collapse all

    Adapter, specified as a systemcomposer.arch.Adapter object.

    Names of input ports, specified as a string or array of strings.

    Example: ["in1","in2"]

    Data Types: string

    Output Arguments

    collapse all

    Ports, specified as an array of systemcomposer.arch.ComponentPort objects.

    More About

    collapse all

    Version History

    Introduced in R2026a