diff --git a/matlab/k_order_pert.m b/matlab/k_order_pert.m index ee22c9964..777e5d253 100644 --- a/matlab/k_order_pert.m +++ b/matlab/k_order_pert.m @@ -26,19 +26,19 @@ order = options.order; switch(order) case 1 - [err, g_1] = k_order_perturbation(dr,M,options, oo , ['.' ... + [err, g_1] = k_order_perturbation(dr,M,options, ['.' ... mexext]); mexErrCheck('k_order_perturbation', err); dr.g_1 = g_1; case 2 - [err, g_0, g_1, g_2] = k_order_perturbation(dr,M,options, oo , ['.' ... + [err, g_0, g_1, g_2] = k_order_perturbation(dr,M,options, ['.' ... mexext]); mexErrCheck('k_order_perturbation', err); dr.g_0 = g_0; dr.g_1 = g_1; dr.g_2 = g_2; case 3 - [err, g_0, g_1, g_2, g_3] = k_order_perturbation(dr,M,options, oo , ['.' ... + [err, g_0, g_1, g_2, g_3] = k_order_perturbation(dr,M,options, ['.' ... mexext]); mexErrCheck('k_order_perturbation', err); dr.g_0 = g_0; diff --git a/mex/sources/k_order_perturbation/k_order_perturbation.cc b/mex/sources/k_order_perturbation/k_order_perturbation.cc index bb437990e..666a6549c 100644 --- a/mex/sources/k_order_perturbation/k_order_perturbation.cc +++ b/mex/sources/k_order_perturbation/k_order_perturbation.cc @@ -70,20 +70,19 @@ extern "C" { mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { - if (nrhs < 5 || nlhs < 2) - DYN_MEX_FUNC_ERR_MSG_TXT("Must have exactly 5 input parameters and take at least 2 output parameters."); + if (nrhs != 4 || nlhs < 2) + DYN_MEX_FUNC_ERR_MSG_TXT("Must have exactly 4 input parameters and take at least 2 output parameters."); const mxArray *dr = prhs[0]; const mxArray *M_ = prhs[1]; const mxArray *options_ = prhs[2]; - const mxArray *oo_ = prhs[3]; mxArray *mFname = mxGetField(M_, 0, "fname"); if (!mxIsChar(mFname)) DYN_MEX_FUNC_ERR_MSG_TXT("Input must be of type char."); string fName = mxArrayToString(mFname); - const mxArray *mexExt = prhs[4]; + const mxArray *mexExt = prhs[3]; string dfExt = mxArrayToString(mexExt); // Dynamic file extension, e.g. ".dll" or ".mexw32" int kOrder;