Main Content

setUnits

Set units for value type

Since R2021b

    Description

    setUnits(valueType,units) sets the units for the designated value type.

    example

    Examples

    collapse all

    Create a model archModel.

    modelName = "archModel";
    arch = systemcomposer.createModel(modelName);
    systemcomposer.openModel(modelName);

    Add a value type airSpeed to the dictionary of the model.

    airSpeedType = arch.InterfaceDictionary.addValueType("airSpeed");

    Set the units for the value type as m/s.

    airSpeedType.setUnits("m/s")

    Input Arguments

    collapse all

    Value type, data element, or function argument, specified as a systemcomposer.ValueType, systemcomposer.interface.DataElement, or systemcomposer.interface.FunctionArgument object.

    Units, specified as a character vector or string.

    Data Types: char | string

    More About

    collapse all

    Version History

    Introduced in R2021b

    See Also

    Functions

    Objects

    Blocks

    Tools