Main Content

delete

Delete AUTOSAR element

Description

delete(arProps,elementPath) deletes the AUTOSAR element at elementPath.

example

Examples

collapse all

Delete the sender-receiver interface Interface1 from the AUTOSAR configuration for a model.

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'}

Input Arguments

collapse all

AUTOSAR properties information for a model, previously returned by arProps = autosar.api.getAUTOSARProperties(model). model is a handle, character vector, or string scalar representing the model name.

Example: arProps

Path to the AUTOSAR element to delete.

Example: 'Input'

Version History

Introduced in R2013b