MATLAB 帮助中心
本页翻译不是最新的。点击此处可查看最新英文版本。
将关闭文件添加到工程中
addShutdownFile(proj,file)
addShutdownFile(proj,file) 向指定工程添加一个关闭文件。在您关闭工程时,工程会自动运行关闭文件。
proj
file
示例
全部折叠
打开 Times Table App 工程。使用 currentProject 从当前加载的工程创建一个工程对象。
currentProject
openExample("matlab/TimesTableProjectExample") proj = currentProject;
指定在工程关闭时要运行的可执行 MATLAB® 代码。通过使其成为关闭文件,工程即可在关闭时自动运行该文件。
filepath = fullfile("utilities","runTheseTests.m"); addShutdownFile(proj,filepath);
matlab.project.Project
工程,指定为 matlab.project.Project 对象。使用 currentProject 从当前加载的工程创建一个工程对象。
要添加的 MATLAB 文件的路径(包括文件扩展名),指定为字符向量或字符串标量。指定相对于工程根文件夹的路径。文件必须在工程根文件夹中。
在 R2019a 中推出
currentProject | openProject | removeStartupFile
openProject
removeStartupFile
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处