Commit 7ef3be34 authored by hbristow's avatar hbristow

By default, all function now export at least one return value back into the…

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
parent 8f92973b
......@@ -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 %}
......
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