We will be using Peter Corke’s Robotic Toolbox 10.4 as part of Robotics, Vision & Control (2nd edition)
https://petercorke.com/toolboxes/robotics-toolbox/
Download the RTB10.4.mltbx package https://petercorke.com/download/27/rtb/1045/rtb10-4-mltbx.mltbx
In Win/MAC double-click on the file (after matlab is installed), it should look as:

The package in practice does 2 things:

Any time you create new code/script/class and place it a new *.m file, you need to add the folder where the code is located for Matlab to be able to find it.
More technically, the MATLAB path is an ordered list of folders that MATLAB searches when you call a function, class, script, or MEX file. If a file is not in the current folder or on the path, MATLAB won’t find it.
Key facts