Using the native method for extending Octave (e.g. DEFUN_DLD) I am able
to declare multiple functions in a single file. All of these can access
the same global data. With mex functions, on the other hand, it seems
as if there can only be one declard per file and that I can't simply
declare a global variable to share between all of them. I looks like I
have to wrap a data structure and continually pass it back to
Matlab/Octave and then back into the mexFunction again. As an
alternative, I suppose I could put an object in the global workspace,
but then I still have to continually wrap it up as a mex variable and
unwrap it again when I want to use it.
Is there some way to put multiple mex functions in a single source file
and/or share data between mex functions more easily?
John Swensen