removeFile

Remove file from project

Description

example

removeFile(proj,file) removes a file from the specified project.

Examples

collapse all

Open the Times Table App project. Use currentProject to create a project object from the currently loaded project.

matlab.project.example.timesTable
proj = currentProject;

Remove a file.

removeFile(proj,"source/timesTableGame.m")

Add the file back to the project.

addFile(proj,"source/timesTableGame.m")

Input Arguments

collapse all

Project, specified as a matlab.project.Project object. Use currentProject to create a project object from the currently loaded project.

File to remove, specified as a character vector, string scalar, or a ProjectFile object. If you specify file as a character vector or string scalar, it must contain the path of the file to remove relative to the project root folder, including the file extension. The file must be in the project.

Introduced in R2019a