prefdir and library path relevance on MRC

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Performance and Memory 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by