addShortcut
向工程添加快捷方式
说明
示例
添加快捷方式
打开 Times Table App 工程。使用 currentProject
从当前加载的工程创建一个工程对象。
openExample("matlab/TimesTableProjectExample")
proj = currentProject;
创建一个新文件。
filepath = fullfile(proj.RootFolder,"newvariables.mat");
save(filepath)
将此新文件添加到工程中。
projectFile = addFile(proj,filepath)
添加指向新文件的新快捷方式。
shortcut = addShortcut(proj,filepath);
shortcut = Shortcut with properties: Name: "newvariables" Group: "General" File: "C:\myProjects\examples\TimesTableApp\newvariables.mat"
输入参数
proj
— 工程
matlab.project.Project
对象
工程,指定为 matlab.project.Project
对象。使用 currentProject
从当前加载的工程创建一个工程对象。
file
— 文件的路径
字符向量 | 字符串标量
快捷方式所指向文件的路径(包含文件扩展名),指定为字符向量或字符串标量。指定相对于工程根文件夹的路径。文件必须在工程根文件夹中。
输出参量
shortcut
— 快捷方式
Shortcut
对象
包含快捷方式有关信息的 Shortcut
对象。
版本历史记录
在 R2019a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)