#include adds a special header file . addpath simply adds the folder to the search path and does not add code to your program. Think about this by adding directories to search for header files in C ++ (for example, in Visual Studio, in "Additional inclusion directories" and g ++ using -I ).
Also, I think addpath checks to see if a folder has been added, so you really do nothing with repeated calls to addpath('lib') .
Jacob source share