Matlab: Testing C++ MEX

Using the Matlab example

copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'), '~')

You can in Matlab or Octave compile the callable C-code by:

mex yprime.c

And then using the compiled C-code function from Matlab or Octave by:

yprime(3,[4,2,7,1])

ans = 2.0000 5.9924 1.0000 2.986

Leave a Comment