How to include .mat files in a compiled standalone application?

19 ビュー (過去 30 日間)
Ethan Narad
Ethan Narad 2022 年 3 月 6 日
コメント済み: Cody Brown 2024 年 7 月 15 日
I am trying to compile an app I've built in the App Designer as a standalone executable. The program includes a large set of .mat files that contain data that is loaded into the program for calculations. Right now, the files are all stored in a folder within the workspace and loaded via their filenames and the "dir" and "load" commands. However, when I try to export the program as a standalone, it is unable to load the files. I restructured it so that all of the files are included under "Files required for your application to run", but it seems this isn't enough for it to find the files. How do I locate files stored within the compiled program?
  1 件のコメント
Ethan Narad
Ethan Narad 2022 年 3 月 6 日
UPDATE: I figured it out; when packaging, there's also a category called "Files installed for your end user" in which I also needed to add in the files.

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

回答 (1 件)

Image Analyst
Image Analyst 2022 年 3 月 6 日
編集済み: Image Analyst 2022 年 3 月 6 日
Use the -a option to specify the full path of the MAT files you'd like built in to the executable.
mcc -m myProgram.m -a 'c:\my work\my mat file.m';
  1 件のコメント
Cody Brown
Cody Brown 2024 年 7 月 15 日
Where in the .mlap file, or in the .prj file that compiles the .mlap, would you place this function?

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

カテゴリ

Help Center および File ExchangeStandalone Applications についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by