Test Matlab C++ MEX

  1. Using the Matlab example
    copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'), '~')
    
  2. in Matlab or Octave compile the callable C-code by:
    mex yprime.c
    
  3. us3 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