From 0b9ff11537eb1e9cbca1155154a7a4e8d0336812 Mon Sep 17 00:00:00 2001 From: hbristow Date: Mon, 24 Jun 2013 13:11:29 -0700 Subject: [PATCH] Fixed bug where expected number of input variables was incorrect if any of the inputs were also outputs --- .../matlab/generator/templates/template_function_base.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/matlab/generator/templates/template_function_base.cpp b/modules/matlab/generator/templates/template_function_base.cpp index 053f27deb..731ac83e8 100644 --- a/modules/matlab/generator/templates/template_function_base.cpp +++ b/modules/matlab/generator/templates/template_function_base.cpp @@ -30,9 +30,8 @@ void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) { // assertions - mexPrintf("nrhs: %d, nlhs: %d\n", nrhs, nlhs); - conditionalError(nrhs >= {{fun.req|length - fun.req|outputs|length}}, "Too few required input arguments specified"); - conditionalError(nrhs <= {{fun.req|length + fun.opt|length - fun.req|outputs|length - fun.opt|outputs|length}}, "Too many input arguments specified"); + conditionalError(nrhs >= {{fun.req|length - fun.req|only|outputs|length}}, "Too few required input arguments specified"); + conditionalError(nrhs <= {{fun.req|length + fun.opt|length - fun.req|only|outputs|length - fun.opt|only|outputs|length}}, "Too many input arguments specified"); conditionalError(nlhs <= {{ fun.rtp|void|not + fun.req|outputs|length + fun.opt|outputs|length}}, "Too many output arguments specified"); // setup