Main Content

matlab.project.createProject

Create blank project

Description

proj = matlab.project.createProject creates and opens a blank project and returns the project object. Use the project object to manipulate the new project at the command line. The new project is created in the default project folder.

example

proj = matlab.project.createProject(path) creates the project in the specified folder.

example

proj = matlab.project.createProject(name) creates the project in the default folder, with the specified name.

example

proj = matlab.project.createProject(Name,Value) specifies additional options as one or more name-value pair arguments.

example

Examples

collapse all

Create a blank project in the default project folder and specify the project name. After the project is created, you can set up the project by adding files to the project, configuring the project path, and specifying startup and shutdown files.

proj = matlab.project.createProject;
proj.Name = "My New Project";

Create a blank project in the specified folder and specify the project name.

proj = matlab.project.createProject("C:\work\myprojectname");

Create a blank project in the default project folder with the specified name.

proj = matlab.project.createProject("myprojectname");

Create a blank project in the default project folder with the specified name.

proj = matlab.project.createProject("Name","myprojectname","Folder","C:\work\mynewproject");

Input Arguments

collapse all

New project path, specified as a character vector or string scalar. If you do not specify the path, matlab.project.createProject creates the project in the default location. You can change the default location in the project preferences.

New project name, specified as a character vector or string scalar.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Name','myprojectname','Folder','C:\work\mynewproject'

Project root folder, if creating a new project, specified as a character vector or string.

Data Types: char | string

New project name, specified as a character vector or string.

Data Types: char | string

Output Arguments

collapse all

Project, returned as a matlab.project.Project object. Use the matlab.project.Project object to programmatically manipulate the currently open project.

Tips

  • To change the default folder for new projects, on the Home tab, in the Environment section, click Preferences. Go to MATLAB > Project and in the New Projects section, set the Default folder.

Version History

Introduced in R2019a