Borrar filtros
Borrar filtros

prefdir and library path relevance on MRC

3 visualizaciones (últimos 30 días)
Jason
Jason el 29 de Sept. de 2015
Respondida: Nidhi Jain el 1 de Oct. de 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

Respuesta aceptada

Nidhi Jain
Nidhi Jain el 1 de Oct. de 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.

Más respuestas (0)

Categorías

Más información sobre Standard File Formats en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by