Main Content


Class: ModelAdvisor.Task
Namespace: ModelAdvisor

Define custom tasks


task_obj = ModelAdvisor.Task(task_ID)


task_obj = ModelAdvisor.Task(task_ID) creates a task object, task_obj, with a unique identifier, task_ID. task_ID must remain constant. If you do not specify task_ID, the Model Advisor assigns a random task_ID to the task object.

You can use one ModelAdvisor.Check object in multiple ModelAdvisor.Task objects, allowing you to place the same check in multiple locations in the Model Advisor tree. For example, Check for implicit signal resolution appears in the By Product > Simulink folder and in the By Task > Model Referencing folder in the Model Advisor tree.

When adding checks as tasks, the Model Advisor uses the task properties instead of the check properties, except for Visible and LicenseName.


In the following example, you create three task objects, MAT1, MAT2, and MAT3.

MAT1 = ModelAdvisor.Task('com.mathworks.sample.TaskSample1');
MAT2 = ModelAdvisor.Task('com.mathworks.sample.TaskSample2');
MAT3 = ModelAdvisor.Task('com.mathworks.sample.TaskSample3');