Contenido principal

matlab.buildtool.PlanElement Class

R2026b

Namespace: matlab.buildtool

Base class for build plan elements

Since R2026b

Description

The matlab.buildtool.PlanElement class defines the minimal shared identity for all elements that you can add to a build plan, such as tasks and task groups. The matlab.buildtool.Task and matlab.buildtool.TaskGroup classes derive from the PlanElement class and inherit its Name and Description properties.

Only the build tool can subclass the PlanElement class. You cannot instantiate the PlanElement class or subclass it directly.

Class Attributes

Abstract
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Properties

expand all

Name of the plan element, specified as a string scalar or character vector, and stored as a string scalar. The build tool sets this property when you add the element to a build plan. For example, plan("taskName") = task sets the Name property of the added task to "taskName".

Attributes:

GetAccess
public
SetAccess
Restricts access

Description of the plan element, specified as a string scalar or character vector, and stored as a string scalar. When the build tool lists the plan elements, it also includes their descriptions.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

Import the Task class.

import matlab.buildtool.Task

Create a plan with no tasks.

plan = buildplan;

Add a task named "mytask" to the plan.

plan("mytask") = Task;

Add a task group named "mygroup", including the "task1" and "task2" tasks, to the plan.

plan("mygroup:task1") = Task;
plan("mygroup:task2") = Task;

Access the elements in the plan. The value stored in the Tasks property of the plan is a vector of PlanElement objects.

elements = plan.Tasks
elements = 

  1×2 heterogeneous PlanElement (Task, TaskGroup) array with properties:

    Description
    Name

Return the names of the plan elements.

names = [elements.Name]
names = 

  1×2 string array

    "mytask"    "mygroup"

Version History

Introduced in R2026b