Prev: tiled texture mapping
Next: crosscorrelation in matlab
From: Philip Borghesani on 29 Mar 2010 11:15 "Jacob Englander" <jenglan3.removethis(a)illinois.edu> wrote in message news:hojd27$nnk$1(a)fred.mathworks.com... >I am rewriting a function which was previously implemented in MATLAB as a mex function for speed. The original function took a >structure as an input and returned a structure as an output. Is there a way to pass a structure directly to a mex file, or perhaps >a way to generate a C/C++ struct from a MATLAB structure? > If the structures are kept simple with no arrays of pointers than the LOADLIBARY, CALLLIB and LIBSTRUCT commands can be used to pass a C structure from MATLAB to a c interfaced function. Take a look at matlabroot\extern\examples\shrlib\shrlibsample.c and the documentation for more information. Phil |