Problem in external file while deploying GUI into a standalone application

1 回表示 (過去 30 日間)
Edison
Edison 2018 年 7 月 25 日
回答済み: Walter Roberson 2018 年 7 月 25 日
I have programmed a GUI that needs different excel files to work. When using the MATLAB Compiler to make it a standalone application, the executable doesn't work. I believe this may be caused by the excel files and their poor routing. I've been told the best way to solve this is using CTFROOT or relative paths but i'm new in that area. Can someone clarify this? The excel files are saved in the same folder as the GUI files. Thanks in advance.
  2 件のコメント
Edison
Edison 2018 年 7 月 25 日
The excel files must not be opened with the function "open" but with the function "winopen"
OCDER
OCDER 2018 年 7 月 25 日
How are you opening/reading excel files in the code? (show code for this)
Are you including the excel files into the compiled application by specifically adding these to the list of files to compile? I believe Matlab's file dependency check does not check for external files that your code depends on.
ex:
mcc -m myGUI.m -a C:\DirOfExcelFiles

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2018 年 7 月 25 日
Best practice is to use fullfile() with ctfroot to construct the filename, and winopen() that
filename = fullfile(ctfroot(), 'TrainedData\Romulus\physcons.xlsx');
winopen(filename);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by