>While this documentation is in the object-oriented section of the >documentation, packages are not limited to use only with MATLAB classdef >files. You can store plain functions in a package and use them as such.
>A third, somewhat "hacky" way to test many small subfunctions in your main >file is to have a syntax that causes the main function to return a struct >array whose fields contain function handles to the subfunctions. Your tests >can then invoke the subfunctions using those function handles even though >the subfunctions are not in scope. As long as the subfunction was in scope >when the function handle was _created_ it doesn't matter if the subfunction >is out of scope when the function handle is _executed._