Main Content

matlab.project.createProject

Create blank project

Description

example

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.

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 comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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.

Introduced in R2019a