I don’t know what matlab is, but from the programmer’s logic what seems wrong and impossible without hacking the code. At the same time, through Google, I saw this:
When you call a script from a function, the script uses the workspace of the function. Like local functions, nested functions have their own workspaces. However, these workspaces are unique in two important ways: Nested functions can receive and modify variables in the workspaces of functions that contain them. All variables in nested functions or functions containing them must be explicitly defined. That is, you cannot call a function or script that assigns values to variables if these variables no longer exist in the workspace of the function.
Base and workspace <
Not sure if this will help at all, but may clarify some points.
source share