Hi I have a fairly simple matlab function. E.g.:
function [MYSTRUCT] = myfunc()
MYSTRUCT.prop1 = 'test';
MYSTRUCT.prop2 = 'foo';
MYSTRUCT.prop3 = 42;
end
I compiled with the matlab compiler sdk a c++ library and added this properly to an c++ program using visual studio (all good so far).
But how do I work with the struct in c++ ? My c++ code looks like this:
//initialize matlab runtime
//initialize my function
mwArray out;
myfunc(1, out);
the function is called properly (e.g. if I add a imshowpair
to the matlab function its displayed properly. so all good here)
the return value of the function thats called by c++ (myfunc()
) is of the type mwArray
and therefore I cannot access the "property" values (in this case "test", "foo" and '42')
How do I access them?
(I thought about an "getter" matlab function maybe, where I can pass over the return value (variable out
) to get the values. Is this possible / a good idea?)