Documentation Center

  • Trial Software
  • Product Updates

setProjectName

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

(To be removed) Change the name of the currently open Simulink project

    Note:   Simulink.ModelManagement.Project.CurrentProject.setProjectName will be removed in a future release. See Project Management for links to project functions.

Syntax

p = Simulink.ModelManagement.Project.CurrentProject()
p.setProjectName(newName)

Description

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

p.setProjectName(newName) changes the name of the currently open Simulink project to the specified newName.

The name change occurs immediately within your current project. If you are using a version control tool for your project, you must commit the changes to the .SimulinkProject folder to source control.

Input Arguments

newName

The new specified name for an open Simulink project that replaces the existing name.

Example

To rename the currently open Simulink project to myProject, use the following commands.

  1. Create an instance of the CurrentProject class.

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

    p.setProjectName('myProject');

See Also

Was this topic helpful?