Manual solution
Perform the following:
- Right click on the folder which is on top of the hierarchy.
- click on Add to path
- Click on selected folders and subfolders
At this stage, your scripts will be able to identify any function or script which resides in one of the inner subfolders which you chose.
In addition you can call any script and function you would like by simply typing it's name in the command line.
Code solution
Instead of doing it manualy, it is also possible to add folders and subfolders into path by using the following code:
addpath(genpath(<path to your directory>))
Example
The tree structure of the current Matlab path

You can add the functions and scripts from Folder 1 into path by either writing the following code:
addpath(genpath('Folder 1'))
Or by using 'Adding folders and subfolders' option from the menu:

After doing so, it is possible to call func straight from main