plot(plan) plots the tasks in the plan as a
dependency graph where nodes represent tasks and edges represent dependencies. Edges in the
graph flow from dependent tasks to depended-on tasks.
The plot visualizes the plan as a directed acyclic graph. It cannot contain any cycles.
Plot the tasks in a build plan as a dependency graph.
Open the example and then navigate to the plot_plan_example folder, which contains a build file.
openExample("matlab/PlotTasksAsDependencyGraphExample")
cd plot_plan_example
This code shows the contents of the build file.
function plan = buildfile
% Create a plan from the task functions
plan = buildplan(localfunctions);
% Make the "archive" task the default task in the plan
plan.DefaultTasks = "archive";
% Make the "archive" task dependent on the "check" and "test" tasks
plan("archive").Dependencies = ["check""test"];
endfunction checkTask(~)
% Identify code issues
issues = codeIssues;
assert(isempty(issues.Issues),formattedDisplayText( ...
issues.Issues(:,["Location""Severity""Description"])))
endfunction testTask(~)
% Run unit tests
results = runtests(IncludeSubfolders=true,OutputDetail="terse");
assertSuccess(results);
endfunction archiveTask(~)
% Create ZIP file
zipFileName = "source_" + ...
string(datetime("now",Format="yyyyMMdd'T'HHmmss"));
zip(zipFileName,"*")
end
Load a plan from the build file.
plan = buildfile
plan =
Plan with tasks:
archive - Create ZIP file
check - Identify code issues
test - Run unit tests
Plot the tasks in the plan as a dependency graph. The graph displays the tasks as nodes. Because the "archive" task depends on the "check" and "test" tasks, the graph also includes two edges that represent these dependencies.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.