removeFileFromProject

Class: Simulink.ModelManagement.Project.CurrentProject
Package: Simulink.ModelManagement.Project

(To be removed) Remove a file from the currently open Simulink project

    Note:   Simulink.ModelManagement.Project.CurrentProject.removeFileFromProject will be removed in a future release. Use removeFile instead.

Syntax

p = Simulink.ModelManagement.Project.CurrentProject()
p.removeFileFromProject(filePath)

Description

p = Simulink.ModelManagement.Project.CurrentProject() creates an instance of the CurrentProject class.

p.removeFileFromProject(filePath) removes a file on the specified filePath from the currently open Simulink project.

Input Arguments

filePath

The fully qualified path to the file within the root folder of the project.

Example

To remove a file from the currently open Simulink project, use the following commands.

  1. Create an instance of the CurrentProject class.

    p = Simulink.ModelManagement.Project.CurrentProject();
  2. Create a fully qualified path for the file.

      Note:   The use of the getDirectory method in this step is optional.

    file = fullfile(p.getRootDirectory, 'work', 'newshortcut.m');
  3. Use the removeFileFromProject method.

    p.removeFileFromProject(file);
Was this topic helpful?