Main Content

plot

플랜에 들어 있는 작업 플로팅

R2022b 이후

설명

예제

plot(plan)은 플랜에 포함된 작업을 종속 관계 그래프로 플로팅합니다. 이때 노드로 작업을 표현하고 간선으로 종속 관계를 표현합니다. 그래프의 간선은 종속 작업에서 상위 작업 방향으로 연결됩니다.

이 플롯은 플랜을 유방향 비순환 그래프로 시각화합니다. 순환은 포함될 수 없습니다.

입력 인수

모두 확장

플랜으로, matlab.buildtool.Plan 객체로 지정됩니다.

예제

모두 확장

빌드 플랜에 들어 있는 작업을 종속 관계 그래프로 플로팅합니다.

예제를 열고 빌드 파일이 포함된 plot_plan_example 폴더로 이동합니다.

cd plot_plan_example

다음 코드는 빌드 파일의 내용을 보여줍니다.

function plan = buildfile
import matlab.buildtool.tasks.CodeIssuesTask
import matlab.buildtool.tasks.TestTask

% Create a plan from task functions
plan = buildplan(localfunctions);

% Add the "check" task to identify code issues
plan("check") = CodeIssuesTask;

% Add the "test" task to run tests
plan("test") = TestTask;

% 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"];
end

function archiveTask(~)
% Create ZIP file
filename = "source_" + ...
    string(datetime("now",Format="yyyyMMdd'T'HHmmss"));
zip(filename,"*")
end

빌드 파일에서 플랜을 불러옵니다.

plan = buildfile
plan = 
  Plan with tasks:

    archive - Create ZIP file
    check   - Identify code issues
    test    - Run tests

플랜에 들어 있는 작업을 종속 관계 그래프로 플로팅합니다. 이 그래프는 작업을 노드로 표시합니다. "archive" 작업이 "check" 작업과 "test" 작업에 종속되므로 그래프에 이 종속 관계를 표현하는 간선이 두 개입니다.

plot(plan)

Figure contains an axes object. The axes object contains an object of type graphplot.

버전 내역

R2022b에 개발됨