diff --git a/examples/matlab/runme.m b/examples/matlab/runme.m index 1657436..bc1a1d1 100644 --- a/examples/matlab/runme.m +++ b/examples/matlab/runme.m @@ -38,11 +38,11 @@ % TRY COMPILING MEX FILE fprintf('Compiling mex function... ') try -mex(fullfile('..','..','src','openGJK.c'),... % Source of openGJK +mex(fullfile('..','..','openGJK.c'),... % Source of openGJK '-largeArrayDims', ... % Support large arrays optflug, ... % Compiler flag for debug/optimisation - fullfile('-I..','..','include'),... % Folder to header files - '-outdir', pwd,... % Ouput directory for writing mex function + fullfile('-I','..','..','include'),... % Folder to header files + '-outdir', pwd, ... % Ouput directory for writing mex function '-output', 'openGJK',... % Name of ouput mex file '-DMATLAB_MEX_BUILD',... % Define variable for mex function in source files silflag ) % Silent/verbose flag diff --git a/openGJK.c b/openGJK.c index c5a0417..d80cd99 100644 --- a/openGJK.c +++ b/openGJK.c @@ -730,7 +730,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { nCoordsB = mxGetN(prhs[1]); /* Create output */ - plhs[0] = mxCreategkFloatMatrix(1, 1, mxREAL); + plhs[0] = mxCreateDoubleMatrix(1, 1, mxREAL); /* get a pointer to the real data in the output matrix */ distance = mxGetPr(plhs[0]); @@ -763,7 +763,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { s.nvrtx = 0; /* Compute squared distance using GJK algorithm */ - distance[0] = gjk(bd1, bd2, &s); + distance[0] = compute_minimum_distance(bd1, bd2, &s); mxFree(arr1); mxFree(arr2);