Main Content

addStereotype

Add stereotype to profile

Description

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

example

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

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: [0x0 systemcomposer.profile.Stereotype]
               AppliesTo: 'Component'
                Abstract: 0
                    Icon: 'default'
    ComponentHeaderColor: [210 210 210]
      ConnectorLineColor: [168 168 168]
      ConnectorLineStyle: 'Default'
      FullyQualifiedName: 'LatencyProfile.electricalComponent'
                 Profile: [1x1 systemcomposer.profile.Profile]
         OwnedProperties: [0x0 systemcomposer.profile.Property]
              Properties: [0x0 systemcomposer.profile.Property]

Input Arguments

collapse all

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

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

Data Types: char | string

Name-Value Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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.

Example: addStereotype(profile,'electricalComponent','Icon','default')

Example: addStereotype(profile,'electricalComponent','Icon','application')

Example: addStereotype(profile,'electricalComponent','Icon','channel')

Example: addStereotype(profile,'electricalComponent','Icon','controller')

Example: addStereotype(profile,'electricalComponent','Icon','database')

Example: addStereotype(profile,'electricalComponent','Icon','devicedriver')

Example: addStereotype(profile,'electricalComponent','Icon','memory')

Example: addStereotype(profile,'electricalComponent','Icon','network')

Example: addStereotype(profile,'electricalComponent','Icon','plant')

Example: addStereotype(profile,'electricalComponent','Icon','sensor')

Example: addStereotype(profile,'electricalComponent','Icon','subsystem')

Example: addStereotype(profile,'electricalComponent','Icon','transmitter')

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 a character vector or string of the following options:

  • 'Component'

  • 'Port'

  • 'Connector'

  • 'Interface'

Example: addStereotype(profile,'electricalComponent','AppliesTo','Port')

Data Types: char | string

Whether stereotype is abstract, specified as a logical. 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].

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].

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

Data Types: uint32

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

Example: addStereotype(profile,'electricalComponent','ConnectorLineStyle','Default')

Example: addStereotype(profile,'electricalComponent','ConnectorLineStyle','Dot')

Example: addStereotype(profile,'electricalComponent','ConnectorLineStyle','Dash')

Example: addStereotype(profile,'electricalComponent','ConnectorLineStyle','Dash Dot')

Example: addStereotype(profile,'electricalComponent','ConnectorLineStyle','Dash Dot Dot')

Data Types: char | string

Output Arguments

collapse all

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

More About

collapse all

Definitions

TermDefinitionApplicationMore Information
stereotypeA stereotype is a custom extension of the modeling language. Stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata.Apply stereotypes to elements: root-level architecture, component architecture, connectors, ports, data interfaces, and value types of a model. A model element can have multiple stereotypes. Stereotypes provide model elements with a common set of property fields, such as mass, cost, and power.Extend Architectural Design Using Stereotypes
propertyA property is a field in a stereotype. For each element the stereotype is applied to, specific property values are specified.Use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. Properties can also be descriptive or represent a status. You can view and edit the properties of each element in the architecture model using the Property Inspector.
profileA profile is a package of stereotypes to create a self-consistent domain of element types.Author profiles and apply profiles to a model using the Profile Editor. You can store stereotypes for a project in one profile or in several. Profiles are stored in XML files when they are saved.

Introduced in R2019a