问题描述
我已经为一些构建脚本开发了GUI,现在正在部署它.由于脚本将在不同位置部署到许多不同的计算机上,因此我需要使用团队使用的标准目录格式.
GUI由".fig"文件(包含UI的直观定义)和定义功能的m脚本组成.我需要分别在"fig/"和"m/"文件夹中找到这两个文件夹,但是我不知道该怎么办.我首先在m脚本中搜索了某种include语句,因为当我单独运行它时,命令窗口中的错误消息指出找不到".fig"文件,但是没有找到.似乎在任何地方都没有对".fig"文件的引用,我认为可以推断出这是因为两个文件的名称相同,但扩展名不同.
我担心Matlab的GUI系统要求".m"和".fig"文件都位于同一位置,但这将是一个不太好的解决方案,如果可以避免的话,我宁愿不这样做. /p>
我接下来要尝试的是调用一个脚本,该脚本将执行时将无花果文件从另一个目录复制到与m脚本相同的位置,然后在脚本退出后删除该副本,这似乎是一个笨拙的解决方案,但可以让我遵守团队的组织惯例.
其他人是否知道指定GUI".fig"文件的相对位置的无证手段?
您可以将GUIDE生成的GUI导出为单个.m
文件.查看此博客文章: GUIDE一个文件中的GUI .
我不确定这是一项新功能还是一直存在的功能之一……
I've developed a GUI for some build scripts, and am now in the process of deploying it. As the script will be deployed to a number of different machines at various points, I need to use the standard format of directories that the team use.
The GUI consists of a ".fig" file that contains the visual definition of the UI, and a m-script that defines the functionality. I need to locate these two in "fig/" and "m/" folders respectively, but I can't figure out how to. I first searched for an include statement of some kind in the m-script, as when I Run it on its own, the error message in the command window states that the ".fig" file can't be found, but there doesn't seem to be a reference to the ".fig" file anywhere, I assume that it's inferred as both files have the same name but a different extension.
I fear that Matlab's GUI system requires that both ".m" and ".fig" files are in the same location, but this will be an inelegant solution that I'd rather not go for if I can avoid it.
The next thing I'm going to try is to call a script that copies the fig file from the other directory to the same location as the m-script, when it is executed, then deletes that copy once the script exits, which again seems a clunky solution, but will allow me to adhere to the team's organisation conventions.
Does anyone else know of an undocumented means of specifying the relative location of a GUI ".fig" file?
You can export the GUIDE-generated GUI as a single .m
file. Check out this blog post: GUIDE GUIs in All One File.
I'm not sure if this is a new feature, or one of those things that has always been there...
这篇关于重定位".fig"使用Matlab GUIDE创建GUI时的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!