|
On 15 Okt, 14:44, "Stiphu " <schm...@pyl.unibe.ch> wrote:
> Hi there
>
> I would like to call a C++ class from Matlab.
>
> Example:
>
> class testClass
> testClass() // Constructor
> getValues() // Function
>
> Now I would like to create this class in Matlab
>
> testClass myClass();
>
> and then call the function
>
> for i = 1:10
> x(i) = getValues;
> end
>
> and then call the destructor at the end of course, like you do it in C++. Is this possible in Matlab?
You can interface matlab with C++, if that's what you ask.
You can do this via the MEX interface. The C++ object are
constructed at the start of the MEX routine, handled in the
body, and destructed at the end of the routine.
However, it is, to my knowledge, not possible to have C++
objects exist statically in the matlab environment. So you
can not construct a C++ object to access from the matlab
workspace.
Rune
|