Saving .mat file in folder created by Matlab Compiler Runtime

2 ビュー (過去 30 日間)
Douglas Anderson
Douglas Anderson 2015 年 10 月 7 日
コメント済み: Image Analyst 2015 年 10 月 7 日
Hello.
One of my users would like a configuration file (a .mat file) to be saved in one of the subfolders (Windows) created when the MCR is installed. In Program Files, a folder is created for the application with a number of subfolders. However, it doesn't seem that you can write there. If I simply save the 'config.mat' file, it goes to the Desktop.
Suggestions Welcome! Thank you.
Doug Anderson

回答 (2 件)

Walter Roberson
Walter Roberson 2015 年 10 月 7 日
See ctfroot . You can use that as the directory name to save the .mat relative to.
  2 件のコメント
Douglas Anderson
Douglas Anderson 2015 年 10 月 7 日
Thanks Walter! I get 'permission denied', though. Is there a subfolder of the ctfroot that is write-permissible?
Walter Roberson
Walter Roberson 2015 年 10 月 7 日
I do not know. I see a hint that save should "just work" provided you have not changed directories; see the savepath discussion in http://blogs.mathworks.com/loren/2008/08/11/path-management-in-deployed-applications/
I have never had the Compiler to play with myself.

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


Image Analyst
Image Analyst 2015 年 10 月 7 日
Windows does not allow you to save anything to certain subfolders, such as any under Program Files. Choose another one, such as under c:\users\public\documents, or c:\programdata.
  2 件のコメント
Douglas Anderson
Douglas Anderson 2015 年 10 月 7 日
Thank you.
For future reference:
A colleague recommended a new folder under c:\users\UserID\AppData\Local, and this seems to work.
Thanks!
Doug
Image Analyst
Image Analyst 2015 年 10 月 7 日
Yes, that will work. But strangely c:\users won't work. it has to be at least one level deeper than that. You're welcome. I just put mine in "public" because I put mine on lab computers where different people could come and login and I want my settings files located in just one place.

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

カテゴリ

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