MATLAB: Running functions from initial working function when in another subfolder

filepath

Hi there,
I noticed that under preferences–> general the user can set the initial working folder for matlab. My friend's computer is set to "based on startup rules" and my is set to a syncd gDrive folder for convenience between my workstations. On my friend's computer he is able to store functions in his startup (initial working) folder i.e.user/docs/MATLAB and RUN THEM from any subfolder of that root. I on the other hand receive an error when I try to do this same thing user a another specified folder selected in the general preferences area.
I would like to have the same flexibility with my function placement as my friend but use the gDrive folder instead of the default user/doc/MATLAB. This allows function calls by just "function name (xx,xxx,..)" instead of specifying the full path each time.
Does anyone know a way I can make this work?
Thanks for your help!!! It is much appreciated!

Best Answer

Why not just put this in your startup.m file:
addpath('g:\folder');
savepath;
Related Question