I have a C++ DLL and its header file. I'm trying to build a MEX function for each function in the DLL, and one of the functions has the following signature:
% // This is from the C++ header file int myFunc( const char * const Input1, SomeStructType * Output1, int & Output2); { ... }
When I try to build a MEX in defining the inputs in my MATLAB workspace and then I run this command:
myFuncReturnValue = coder.ceval('myFunc', coder.ref(Input1), coder.ref(Output1), ***???***)
int myFunc(int& out);
myFunc.cpp
#include "myFunc.hpp" int myFunc(int& out) { out = 2; return 5; }
myFuncWrapper.hpp
#include "myFunc.hpp" inline int myFuncWrapper(int* out) { return myFunc(*out); };
callMyFuncWrapper.m
function y = callMyFuncWrapper %#codegen y = int32(0); if coder.target('MATLAB') % Executing in MATLAB, call MATLAB equivalent of % C function myFuncWrapper y = int32(5 + 2); else % Executing in generated code, call C function myFuncWrapper coder.updateBuildInfo('addSourceFiles','myFunc.cpp'); coder.cinclude('myFuncWrapper.hpp'); in = int32(0); y = coder.ceval('myFuncWrapper', coder.ref(in)); y = y + in; end end
Call codegen
>> codegen callMyFuncWrapper -report -lang:c++
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.