I just realized that MATLAB cannot access functions inside a subfolder that resides inside a private folder.
I have a project that uses several functions from one MATLAB toolbox. In an attempt to make the entire project portable, I extracted the root folder of the toolbox and pasted it inside a private folder inside the project folder, so that my project could be executed in a computer that does not have that particular toolbox installed.
However, since the toolbox functions are stored inside many subfolders, this seems to prevent MATLAB from accessing them.
My idea is to preserve the toolbox folder hierarchy as is, instead of spilling the toolbox functions inside the private folder.
Why can MATLAB access functions that reside directly inside a private folder but can't access functions inside a subfolder that resides inside a private folder?
Is it possible to allow access to this subfolder?
For those of you unfamiliar with private folders, gnovice has a very good explanation here.
Example:
Take the following simplified version of the problem, where we have:
- Three folders:
Project
,private
andtoolbox
- Three functions:
foo.m
,privateFunction1.m
andprivateFunction2.m
With the following hierarchy:
The problem:
foo.m
can access privateFunction1.m
but not privateFunction2.m
.