Commit b6359071 authored by Houtan Bastani's avatar Houtan Bastani

fixed bug in argument number check and removed unused variable

parent e7843e34
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment