Main Content

target.Alias Class

Namespace: target

Create alternative identifier for target object

Description

Use the target.Alias class to create alternative identifiers for target objects. For example, if a target object has a long class identifier, you can create a target.Alias object that provides a short identifier for the target object.

To create a target.Alias object, use the target.create function.

Properties

expand all

Alternative identifier for target object.

Attributes:

GetAccess
public
SetAccess
public

Original target object.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

To create alternative identifiers for target objects, use the target.Alias class.

For example, if a target.Processor object has a long class identifier, you can create a target.Alias object that provides a short identifier for the target.Processor object.

Retrieve the target.Processor object.

proccesorObj = target.get("Processor", ...
  "Analog Devices-ADSP-CM40x (ARM Cortex-M)");

Use the target.create function to create a target.Alias object.

aliasProcessorObj = target.create("Alias");

Use target.Alias object properties to specify the alternative identifier and original target object.

aliasProcessorObj.Name = "myShortName";
aliasProcessorObj.For = proccesorObj;

Add the target.Alias object to an internal database.

objectsAdded = target.add(aliasProcessorObj);
"target.add" summary:

    Objects added to internal database for current MATLAB session:
        target.Alias        "myShortName"
    Objects not added because they already exist:
        target.Processor    "Analog Devices-ADSP-CM40x (ARM Cortex-M)"

To retrieve the original target.Processor object, enter:

target.get("Processor","myShortName");

To remove the objects from the internal database, enter:

target.remove(objectsAdded)
"target.remove" summary:

    Objects removed from internal database:
        target.Alias    "myShortName"

Version History

Introduced in R2019a