Main Content

addStereotype

Add stereotype to profile

Description

stereotype = addStereotype(profile,name) adds a new stereotype with a specified name name to a profile profile.

stereotype = addStereotype(___,Name=Value) adds a new stereotype with the previous input arguments and specifies properties for the stereotype.

example

Examples

collapse all

Add a component stereotype to a profile.

profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");
stereotype = addStereotype(profile,"electricalComponent",AppliesTo="Component")
stereotype = 
  Stereotype with properties:

                    Name: 'electricalComponent'
             Description: ''
                  Parent: [0×0 systemcomposer.profile.Stereotype]
               AppliesTo: 'Component'
                Abstract: 0
                    Icon: ''
    ComponentHeaderColor: [210 210 210]
      ConnectorLineColor: [168 168 168]
      ConnectorLineStyle: 'Default'
      FullyQualifiedName: 'LatencyProfile.electricalComponent'
                 Profile: [1×1 systemcomposer.profile.Profile]
         OwnedProperties: [0×0 systemcomposer.profile.Property]
              Properties: [0×0 systemcomposer.profile.Property]

close(profile,true)

Input Arguments

collapse all

Profile, specified as a systemcomposer.profile.Profile object.

Stereotype name, specified as a character vector or string. The name of the stereotype must be unique within the profile.

Example: "electricalComponent"

Data Types: char | string

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: addStereotype(profile,'electricalComponent',AppliesTo="Component")

Description text for stereotype, specified as a character vector or string.

Example: addStereotype(profile,'electricalComponent',Description="These components are electrical")

Data Types: char | string

Icon name for stereotype, specified as a character vector or string. Built in options include:

  • "default"

  • "application"

  • "channel"

  • "controller"

  • "database"

  • "devicedriver"

  • "memory"

  • "network"

  • "plant"

  • "sensor"

  • "subsystem"

  • "transmitter"

This name-value argument is only valid for component stereotypes. The element a stereotype applies to is set with the AppliesTo name-value argument.

Example: addStereotype(profile,"electricalComponent",Icon="default")

Data Types: char | string

Stereotype from which stereotype inherits properties, specified as a systemcomposer.profile.Stereotype object.

Example: addStereotype(profile,"electricalComponent",Parent=baseStereotype)

Element type to which stereotype can be applied, specified as one of these options:

Example: addStereotype(profile,"electricalComponent",AppliesTo="Port")

Data Types: char | string

Whether stereotype is abstract, specified as 1 (true) or 0 (false). If true, then the stereotype cannot be directly applied on model elements, but instead serves as a parent for other stereotypes.

Example: addStereotype(profile,'electricalComponent','Abstract',true)

Data Types: logical

Component header color, specified as a 1x3 uint32 row vector in the form [Red Green Blue].

This name-value argument is only valid for component stereotypes. The element a stereotype applies to is set with the AppliesTo name-value argument.

Example: addStereotype(profile,'electricalComponent','ComponentHeaderColor',[206 232 246])

Data Types: uint32

Connector line color, specified as a 1x3 uint32 row vector in the form [Red Green Blue].

This name-value argument is only valid for connector, port, and interface stereotypes. The element a stereotype applies to is set with the AppliesTo name-value argument.

Example: addStereotype(profile,'electricalComponent','ConnectorLineColor',[206 232 246])

Data Types: uint32

Connector line style name, specified as a character vector or string. Options include:

  • "Default"

  • "Dot"

  • "Dash"

  • "Dash Dot"

  • "Dash Dot Dot"

This name-value argument is only valid for connector, port, and interface stereotypes. The element a stereotype applies to is set with the AppliesTo name-value argument.

Data Types: char | string

Output Arguments

collapse all

Created stereotype, returned as a systemcomposer.profile.Stereotype object.

More About

collapse all

Version History

Introduced in R2019a