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

(To be removed) Get a list of files in the currently open Simulink project

    Note:   Simulink.ModelManagement.Project.CurrentProject.getFilesInProject will be removed in a future release. Instead, use simulinkproject and then access the Files property of the project object.


p = Simulink.ModelManagement.Project.CurrentProject()
projFiles = p.getFilesInProject
projFiles = p.getFilesInProject(includeFolders)


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

projFiles = p.getFilesInProject returns a cell array of strings containing the fully qualified filenames of all the files and the folders in the currently open Simulink® project.

projFiles = p.getFilesInProject(includeFolders) specifies whether to include folders in the list of project files. includeFolders is an optional logical input specifying whether to include folders (true) or exclude folders (false). Default: true.


To get the names of files in the currently open Simulink project, use the following commands.

  1. Create an instance of the CurrentProject class.

    p = Simulink.ModelManagement.Project.CurrentProject()
  2. Use the getFilesInProject method.

    projFiles = p.getFilesInProject;
  3. To view the cell array containing the file names, use

  4. Use the getFilesInProject method and exclude folders.

    projFiles = p.getFilesInProject(false);
Was this topic helpful?