Main Content

matlab.buildtool.Plan.load

Class: matlab.buildtool.Plan
Namespace: matlab.buildtool

Load plan from file into workspace

Since R2022b

Description

example

plan = matlab.buildtool.Plan.load loads a plan from a build file into the MATLAB® workspace. The build file must be named buildfile.m and must be in the current folder. The method returns the plan as a matlab.buildtool.Plan object.

example

plan = matlab.buildtool.Plan.load(filename) loads a plan from the specified build file. To maintain valid relative paths in the main function of the file, the build tool first changes the current folder to the folder containing the file. Once the plan is in the workspace, the build tool restores the current folder to its original state.

Input Arguments

expand all

Name of the build file, specified as a string scalar or character vector ending in .m. The value can be a path relative to the current folder or an absolute path.

Example: "C:\work\buildfile.m"

Example: "..\buildfile.m"

Attributes

Statictrue

To learn about attributes of methods, see Method Attributes.

Examples

expand all

Load a plan from a build file that exists in the current folder.

Assume that the file buildfile.m is in your current folder. Load a plan from the file.

plan = matlab.buildtool.Plan.load;

Now that you have access to the Plan object, you can modify the plan, or plot or run tasks in the plan. For example, plot the tasks in the plan as a dependency graph.

plot(plan)

Load a plan from a build file that exists one level up from the current folder.

Assume that the file buildfile.m is one level up from your current folder. Load a plan from the file.

plan = matlab.buildtool.Plan.load("..\buildfile.m");

Now that you have access to the Plan object, you can modify the plan, or plot or run tasks in the plan. For example, plot the tasks in the plan as a dependency graph.

plot(plan)

Version History

Introduced in R2022b