【问题标题】:Find path of compiled app in MATLAB在 MATLAB 中查找已编译应用程序的路径
【发布时间】:2017-01-25 14:43:14
【问题描述】:

我正在编译我的应用程序是由应用程序设计师 (MATLAB R2016b) 设计的。我在编译器的这一部分添加了一些额外的文件:

在我的代码中,我在编译后使用ctfroot 查找路径,但是当我使用编译后的 GUI 并且我想从 GUI 打开其中一个文件时,两个路径之间存在差异。

Real path:
C:\Users\myY\AppData\Local\Temp\my_user\mcrCache9.1\Main_a4\Main_app_r20

Returned path by `ctfroot` function:
C:\Users\myY\AppData\Local\Temp\my_user\mcrCache9.1\Main_a4\

Main_app_r20 文件夹名称在每次使用 GUI 和在每台计算机中都是不变的?

【问题讨论】:

  • 你为什么不能fullfile(ctfroot, 'Main_app_r20', 'vba_size_2_in.txt')
  • @Suever 我没有创建Main_app_r20 文件夹。它是由 MATLAB! 创建的。这个文件夹是什么?是否在每次使用 GUI 时都保持不变?

标签: matlab compiler-errors matlab-compiler


【解决方案1】:

您不想要exe 目录吗?即 exe 所在的位置(通常在程序文件中),这是您其他所需文件(通常)所在的位置。

这是我在部署的应用程序中为获取 exe 文件夹所做的:

  [status, result] = system('path');
  installpath = char(regexpi(result, 'Path=(.*?);', 'tokens', 'once'));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-22
    • 1970-01-01
    • 2013-06-06
    相关资源
    最近更新 更多