By default, all function now export at least one return value back into the Matlab workspace, even if none are requested. This is in line with Matlab's calling convention, where functions called without an lvalue or a semicolon have their first output printed to the terminal

This commit is contained in:
hbristow 2013-08-07 00:14:13 +10:00
parent 8f92973b8c
commit 7ef3be3429
2 changed files with 4 additions and 3 deletions
modules/matlab

@ -73,8 +73,9 @@ ocv_add_module(matlab BINDINGS
opencv_nonfree
)
# set the path to the C++ header parser
set(HDR_PARSER_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../python/src2)
# set the path to the C++ header and doc parser
set(HDR_PARSER_PATH ${CMAKE_SOURCE_DIR}/modules/python/src2)
set(RST_PARSER_PATH ${CMAKE_SOURCE_DIR}/modules/java/generator)
# set mex compiler options
prepend("-I" MEX_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)

@ -50,7 +50,7 @@ void mexFunction(int nlhs, mxArray*{% if fun|noutputs %} plhs[]{% else %}*{% end
{% if fun|noutputs %}
// push the outputs back to matlab
for (size_t n = 0; n < static_cast<size_t>(nlhs); ++n) {
for (size_t n = 0; n < static_cast<size_t>(std::max(nlhs,1)); ++n) {
plhs[n] = outputs[n].toMxArray().releaseOwnership();
}
{% endif %}