MATLAB 帮助中心
删除 AUTOSAR 元素
delete(arProps,elementPath)
delete(arProps,elementPath) 删除位于 elementPath 的 AUTOSAR 元素。
arProps
elementPath
示例
全部折叠
从模型的 AUTOSAR 配置中删除发送方-接收方接口 Interface1。
Interface1
hModel = 'autosar_swc_expfcns'; openExample(hModel); arProps = autosar.api.getAUTOSARProperties(hModel); % Add Interface3 addPackageableElement(arProps,'SenderReceiverInterface','/pkg/if','Interface3'); ifPaths = find(arProps,[],'SenderReceiverInterface','PathType','FullyQualified')
ifPaths = 1×3 cell array {'/pkg/if/Interface1'} {'/pkg/if/Interface2'} {'/pkg/if/Interface3'}
% Find AUTOSAR DataReceiverPort and change its interface from Interface1 to Interface3 arPortType = 'DataReceiverPort'; aswcPath = find(arProps,[],'AtomicComponent','PathType','FullyQualified'); rPorts = find(arProps,aswcPath{1},arPortType,'PathType','FullyQualified'); rPort = rPorts{1}; set(arProps,rPort,'Interface','Interface3') % Delete Interface1 delete(arProps,'Interface1'); ifPaths = find(arProps,[],'SenderReceiverInterface','PathType','FullyQualified')
ifPaths = 1×2 cell array {'/pkg/if/Interface2'} {'/pkg/if/Interface3'}
模型的 AUTOSAR 属性信息,以前由 arProps = autosar.api.getAUTOSARProperties(model) 返回。model 是一个表示模型名称的句柄、字符向量或字符串标量。
arProps = autosar.api.getAUTOSARProperties(model)
model
示例: arProps
要删除的 AUTOSAR 元素的路径。
示例: 'Input'
'Input'
在 R2013b 中推出
autosar.api.getAUTOSARProperties | add
autosar.api.getAUTOSARProperties
add
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处