removeElement
Description
removeElement(
removes the function element with the name serviceInterfaceObj,elementName)elementName from the
service interface ServiceInterfaceObj.
Examples
To configure function elements of a service interface, use the
addElement, getElement, and removeElement functions.
In this example, the dictionary MyInterfaces.sldd contains
one service interface.
archDataObj = Simulink.dictionary.archdata.open("MyInterfaces.sldd")archDataObj =
ArchitecturalData with properties:
DictionaryFileName: 'MyInterfaces.sldd'
Interfaces: [1×1 Simulink.dictionary.archdata.ServiceInterface]
DataTypes: [0×0 Simulink.dictionary.archdata.DataType]
Constants: [0×0 Simulink.dictionary.archdata.Constant]Get the service interface object using the getInterface function. The service interface object contains two
function element objects.
serviceInterfaceObj = getInterface(archDataObj,"ServiceInterface1")serviceInterfaceObj =
ServiceInterface with properties:
Name: 'ServiceInterface1'
Description: ''
Elements: [1×2 Simulink.dictionary.archdata.FunctionElement]
Owner: [1×1 Simulink.dictionary.ArchitecturalData]To create a function element object and add it to the service interface, use
the addElement function.
funcElemObj3 = addElement(serviceInterfaceObj,"functionElement3")funcElemObj3 =
FunctionElement with properties:
FunctionPrototype: 'y = functionElement3(u)'
Asynchronous: 0
FunctionArguments: [1×2 Simulink.dictionary.archdata.FunctionArgument]
Name: 'functionElement3'
Owner: [1×1 Simulink.dictionary.archdata.ServiceInterface]To access an existing function element, use the getElement function.
funcElemObj2 = getElement(serviceInterfaceObj,"functionElement2")funcElemObj2 =
FunctionElement with properties:
FunctionPrototype: 'y = functionElement2(u)'
Asynchronous: 0
FunctionArguments: [1×2 Simulink.dictionary.archdata.FunctionArgument]
Name: 'functionElement2'
Owner: [1×1 Simulink.dictionary.archdata.ServiceInterface]To remove a function element from a service interface, use the removeElement function.
removeElement(serviceInterfaceObj,"functionElement1")The service interface object now contains only two function elements,
functionElement2 and
functionElement3.
serviceInterfaceObj.Elements(1)
ans =
FunctionElement with properties:
FunctionPrototype: 'y = functionElement2(u)'
Asynchronous: 0
FunctionArguments: [1×2 Simulink.dictionary.archdata.FunctionArgument]
Name: 'functionElement2'
Owner: [1×1 Simulink.dictionary.archdata.ServiceInterface]serviceInterfaceObj.Elements(2)
ans =
FunctionElement with properties:
FunctionPrototype: 'y = functionElement3(u)'
Asynchronous: 0
FunctionArguments: [1×2 Simulink.dictionary.archdata.FunctionArgument]
Name: 'functionElement3'
Owner: [1×1 Simulink.dictionary.archdata.ServiceInterface]Input Arguments
Service interface containing the function element, specified as a Simulink.dictionary.archdata.ServiceInterface object.
Function element name, specified as a character vector or string scalar.
Data Types: char | string
Version History
Introduced in R2023b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)