I use a DOS batch script to call the matlab Command Window (matlab -nodesktop -nosplash -noFigureWindows -r "myscript"
), and the script relies on some functions in different folders, which are in my path.
When I run this, the matlab Command Window which is created cannot find one of these functions, saying 'undefined function or variable'. This function is definitely in my path in the full Desktop version of matlab, but the path loaded in the Command Window version does not have that folder in it.
Calling which pathdef
gives the same file in both versions, and they both have the same contents, but calling p=path;
gives different paths, with the Command Window version only having psychtoolbox folders and the '\Documents\MATLAB' folders, not the folder this function is in.
Do you know how to get the Command Window to use the same path as the Desktop Window?