Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

工程文件管理

搜索、标记、批处理、共享和升级工程文件以及创建脚本。

通过工程,您可以查找所需的文件、管理并共享文件和设置以及与源代码管理进行交互,从而有助于您组织大型建模工程。请参阅什么是工程?

函数

全部展开

currentProject获取当前工程
openProject加载现有工程
addFile将文件或文件夹添加到工程中
addFolderIncludingChildFiles将文件夹和子文件添加到工程中
addLabel将标签附加到工程文件
addPath将文件夹添加到工程路径
addReference将引用工程添加到工程中
addShortcut向工程添加快捷方式
close关闭工程
createCategory创建工程标签的类别
createLabel创建工程标签
export将工程导出到存档
findCategory查找标签的工程类别
findFile按名称查找工程文件
findLabel获取工程文件标签
isLoaded确定工程是否已加载
reload重新加载工程
removeCategory删除标签的工程类别
removeLabel从工程中删除标签
runChecks运行所有工程检查

旧版 API

simulinkproject(不推荐)打开工程并获取工程对象
slproject.loadProject(Not recommended) Load project
slproject.getCurrentProjects(Not recommended) List all top-level projects

主题

编写脚本

Automate Project Tasks Using Scripts

Use the project API to automate project tasks manipulating files, including working with modified files, dependencies, shortcuts, and labels.

常见任务

Open Recent Projects

Open recent projects from MATLAB® or Simulink®.

创建常见任务的快捷方式

在工程中,可以为常见工程任务创建快捷方式,以便于查找和访问重要文件和操作。例如,查找并打开顶层模型,运行代码(例如,加载数据),以及仿真模型。要运行启动或关闭代码,请参阅 Automate Startup Tasks。

Use Shortcuts to Find and Run Frequent Tasks

In a project, use shortcuts to make it easy for any project user to find and access important files and operations.

文件管理

Group and Sort File Views

Control list or tree view columns and hide folders in project file views.

Search Inside Project Files and Filter File Views

Search inside models and other files across your project, and filter files to display.

Work with Project Files

Access common file operations using the context menu in a project.

Manage Shadowed and Dirty Models and Other Project Files

Avoid working on the wrong files using project tools, check for unsaved changes in models, and close models when closing a project.

Move, Rename, Copy, or Delete Project Files

Project refactoring tools help you find and fix impact with automatic updates when you rename, delete, or move files and folders.

Back Out Changes

Undo recent changes in a project.

文件标记

Create Labels

In a project, use labels to organize files and communicate information to project users.

Add Labels to Files

In a project, use labels to organize files and communicate information to project users.

View and Edit Label Data

When you select a file in the project Files view, the file labels appear in the label editor view.

自定义任务处理

Create a Custom Task Function

Create functions and run them on selected project files.

Run a Project Custom Task and Publish Report

Run a function on selected project files, view results, and create a report of the results.

共享工程

Archive Projects

Package and share project files in an archive file, for example to share with others who do not have access to the connected source control tool.

Share Project by Email

To package and share project files on Windows®, you can email your project as an archive file.

Share Project as a MATLAB Toolbox

To package and share project files, create a MATLAB toolbox from your project.

在 GitHub 上共享工程

要共享您的工程,请在 GitHub® 上使您的工程公开可用。

升级工程

Upgrade All Project Models, Libraries, and MATLAB Code Files

Upgrade all the models, libraries and MATLAB code files in your project using the Upgrade Project tool in a project.

关于工程

什么是工程?

使用工程可帮助您组织工作。查找所有必需的文件;管理和共享文件、设置以及用户定义的任务;与源代码管理进行交互。

What Can You Do With Project Shortcuts?

In a project, use shortcuts to make it easy for any project user to find and access important files and operations.

Sharing Projects

Collaborate by sharing projects by email, archive file, template, MATLAB toolbox, or on GitHub.

特色示例