removeFile - Remove file or folder from project - MATLAB (original) (raw)

Main Content

Remove file or folder from project

Syntax

Description

removeFile([proj](#mw%5Fe9ee601c-e029-43a7-9d38-cc1abd7e17e4),[fileOrfolder](#mw%5F38d34d18-8255-4974-95eb-b434511f9e1c)) removes a file or folder from the specified project.

example

Examples

collapse all

Remove File from Project

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

openExample("matlab/TimesTableProjectExample") 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

proj — Project

matlab.project.Project object

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

fileOrfolder — File or folder to remove

character vector | string scalar | ProjectFile object

File or folder to remove, specified as a character vector, string scalar, or a ProjectFile object. If you specifyfileOrfolder 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 or folder must be in the project.

Version History

Introduced in R2019a