From: paul Shen on 16 Jul 2010 18:56 matlab only looks in current directory for a non .m files. can i add other directories to "search path" like addpath for .m files? thanks!!
From: Jan Simon on 17 Jul 2010 07:39 Dear Paul, > matlab only looks in current directory for a non .m files. can i add other directories to "search path" like addpath for .m files? thanks!! No, Matlab looks in the complete path e.g. if you open a file with "fopen(FileName, 'rb')". Try this with e.g. FileName = 'ismembc.cpp'. Therefore ADDPATH should do what you want. You could try WHICH to get the full path of the file. It is always strongly recommended to use full paths, because otherwise a programmer has no influence to determine, which file is chosen, if the file name is not unique. E.g. if you try to open "Contents.m": The result of "which Contents.m" depends on the current folder! If you work in a multi-threading environment partial paths in file names are a horrible source of errors. Imagine a TIMER with a callback, which changes the current folder temporarily to wirte some log data. Are you sure that your expanded search path method is stilll working reliably?! Good luck, Jan
|
Pages: 1 Prev: Help on if-statement Next: Parfor not executing if statements |