フィルターのクリア

deploying code with paths

4 ビュー (過去 30 日間)
Vanessa
Vanessa 2017 年 5 月 2 日
コメント済み: Adam 2017 年 5 月 15 日
Hello everyone,
I'm trying to create an exe from an m.file which contains paths for other folders. When I deploy the code I get the error that the folder is unaccessible. How can I solve this without changing the path management? Is there a way to add these folders to search path or somewhere else so in compile time they would get accessed?
Thank you!!!
  1 件のコメント
Adam
Adam 2017 年 5 月 2 日
You should always use relative paths if you are referring to Matlab files that are on your path. These will be in a totally different location when built in an executable so there is no way you can work with a hard-coded path if that is what you have. Obviously if it were a hard-coded path to some arbitrary data file you want to open then that would still work if the exe is run on the same machine although that is still not advisable.

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

回答 (1 件)

Vanessa
Vanessa 2017 年 5 月 15 日
Thank you for your help. About something else. I have a .mat file which contains data that are used inside the main .m file.I enclude this file into the folder of the executable. Every time the code run this mat file updated with new data. my question is if I have to deploy every time the .mat file so it gets updated ot it is get updated inside the exe.
Thanks, Vanessa
  1 件のコメント
Adam
Adam 2017 年 5 月 15 日
You should only have to deploy a file once, but it does depend on how you use it as to what exactly needs to be done. Personally I have setup an environment variable that gets set on people's machines when they run an exe, pointing to a directory of their choice that the program can use, then I copy relevant files into this directory when the executable runs.

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

カテゴリ

Help Center および File ExchangeManage Products についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by