kyamagu / mexplus

C++ Matlab MEX development kit.
Other
99 stars 49 forks source link

Not able to set a cell with mxArray* #15

Closed a-ma72 closed 7 years ago

a-ma72 commented 7 years ago

I currently try to set a cell item by another mxArray* item:

MxArray data( MxArray::Numeric<double>( 10, 20 ) );
MxArray cells( MxArray::Cell( 3, 3 ) );
cells.set( 0, 0, data.release() ); // cells.set( 0, data.release() ) don't too

Is there a proper way to do this?

Regards, Andreas

kyamagu commented 7 years ago

@AndreasMartin72 Seems cells.set(0, data.release()) works with gcc 4.8.4 on Ubuntu 14.04 + Matlab R2014a. At least this compiler can correctly identify the method signature:

MxArray::void set(mwIndex index, mxArray* value)

The other signature (row-column index) is not included in the current MxArray definition. Perhaps this has to be implemented...