prefdir and library path relevance on MRC

1 回表示 (過去 30 日間)
Jason
Jason 2015 年 9 月 29 日
回答済み: Nidhi Jain 2015 年 10 月 1 日
I need to modify the librarypath.txt file to run an external program via matlab. I understand that using prefdir in the matlab environment gives the directory to where this is located.
So I am using the following code to add a new folder location (i.e. 'C:/Program Files/Micro-Manager-1.4')
lpfile = fullfile(prefdir, 'librarypath.txt');
[fid, message] = fopen(lpfile, 'at');
if fid < 0;
error('Could not open file because: %s', message);
end
fseek(fid, 0, 'eof');
fprintf(fid, '%s\n', 'C:/Program Files/Micro-Manager-1.4');
fclose(fid)
However, I then complie this so to use on a seperate PC with no matlab but just the MCR. So my question is how the librarypath.txt file work now on the target PC, presuambly the prefdir command isn't relevant to this.
Thnaks for any advice Jason

採用された回答

Nidhi Jain
Nidhi Jain 2015 年 10 月 1 日
The machine with only MCR installed will also return a location for "prefdir". For a project named "textMlA", it returned "C:\Users\nidhij\AppData\Local\Temp\nidhij\mcrCache8.5\textMl0\.matlab" on my machine.
When you execute your code on the machine with only MCR, it will refer to the "librarypath.txt" located in a similar folder and make edits to that. If the file does not already exist, it will create the .txt file and make changes to it.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStandard File Formats についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by