Test Matlab C and C++ MEX

These commands are all from within Matlab. They demonstrate that Matlab (or GNU Octave) MEX C / C++ compiler wrapper is working on your system.

  1. Using the Matlab example to your home directory with homepath.m

    copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'), homepath)
    1. in Matlab or GNU Octave compile the callable C-code by:
  2. use the compiled C-code function from Matlab or Octave by:


    which returns

    ans = 2.0000 5.9924 1.0000 2.986


    if you get missing compiler errors, do Mex setup