Filter löschen
Filter löschen

prefdir and library path relevance on MRC

3 Ansichten (letzte 30 Tage)
Jason
Jason am 29 Sep. 2015
Beantwortet: Nidhi Jain am 1 Okt. 2015
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

Akzeptierte Antwort

Nidhi Jain
Nidhi Jain am 1 Okt. 2015
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.

Weitere Antworten (0)

Kategorien

Mehr zu Standard File Formats finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by