matlab - What does this setup.m file do and what is it for? -


what this setup.m file do?

    function setup %setup adds directories metrics matlab path % %   author: ben hamner (ben@benhamner.com)  mydir = fileparts(mfilename('fullpath')); paths = genpath(mydir); paths = strread(paths,'%s','delimiter',':'); pathstoadd = [];  i=1:length(paths)     thispath = paths{i};     thispathsplit = strread(thispath,'%s','delimiter','/');     addthispath = 1;      % not add directories or files starting . or ~     j=1:length(thispathsplit)         thisstr = thispathsplit{j};         if (~isempty(thisstr)) && ((thisstr(1) == '.') || (thisstr(1) == '~'))             addthispath = 0;         end     end     if addthispath ==1         if ~isempty(pathstoadd)             thispath = [':' thispath];         end         pathstoadd = [pathstoadd thispath];     end end  addpath(pathstoadd); savepath; 

i understand description adds directories matlab's search path. 1 , why? matlab scripts scattered addpath('data') lines. mean don't have anymore? comments appreciated.

the file linking setup file metrics package - adds paths various folders can use metrics package without setting paths manually.
more setup.m function adds paths @ level , below located. if copy file directory , run - add directory , subdirs , subdirs of subdirs etc. (excluding folders starting . or ~)

but have hunch looking this: http://www.mathworks.com/help/matlab/ref/startup.html
http://www.mathworks.com/help/matlab/ref/matlabrc.html


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -