annotate toolboxes/graph_visualisation/graphViz4Matlab/util/addtosystempath.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function addtosystempath(p)
wolffd@0 2 % Add p to the system path. If p is already on the path, this does nothing.
wolffd@0 3 % Note, this change only persists for the duration of the Matlab session.
wolffd@0 4 % Do not include path delimiters like ; or : .
wolffd@0 5 % Example:
wolffd@0 6 % addtosystempath('C:\Users\matt\bin');
wolffd@0 7
wolffd@0 8 if isempty(getenv('PATH')) || all(cellfun(@(c)isempty(c),strfind(tokenize(getenv('PATH'),pathsep()),p)));
wolffd@0 9 setenv('PATH', [p, pathsep(), getenv('PATH'),]);
wolffd@0 10 end
wolffd@0 11
wolffd@0 12 end