3

I'm doing matlab java interfacing using javabuilder. In my matlab code, the function returns a cellarray which is to be casted to java datatype. The value cellarray is retrieved into MWArray. But

I'm not able to cast individual cell data into java datatype.

The cellArray contains string data in each cell. say the cellarray is casted to MWArray 'x' variable. Can any one explain me how to do further casting?

1 Answer 1

3

I've got the answer to this question... the value returned should be casted to MWCellArray and later getCell function should be used to get the cell value which will be MWArray object.

This MWArray is the value returned..

The code will be::

Object[] o = <matlab function called>
MWCellArray x = (MWCellArray)o[0];

MWArray arr = x.getCell(new int[]{1,1});

in my case arr was represeting a String. So, arr.toString() gives the required result .. :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.