A solution close to what you are looking for could be using classes. The class contains methods that can be public (visible from the outside) or private (visible only from the inside). Implementations of class methods can be either in multiple files or in the same file.
Here is a simplified example
classdef Class1 methods (Static) function Hello disp('hello'); end function x = Add(a,b) x = Class1.AddInternal(a,b); end end methods (Static, Access=private) function x = AddInternal(a,b) x = a+ b; end end end
Example usage -:
>> Class1.Hello hello >> Class1.Add(1,2) ans = 3 >> Class1.AddInternal(2,3) Error using Class1.AddInternal Cannot access method 'AddInternal' in class 'Class1'.
gregswiss
source share