Pranjaliv / matlabcontrol

Automatically exported from code.google.com/p/matlabcontrol
0 stars 0 forks source link

How can I get return parameters from a Matlab function #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of matlabcontrol are you using?
(Release versions: 4.0.0, 3.1.0, 3.0.1, 3.0.0, or 2.0.0)
4.0.0

What version of MATLAB are you using?
R2010a

What operating system are you using?
WinXP

Are you using matlabcontrol from inside MATLAB or outside MATLAB?
outside Matlab

What steps will reproduce the problem?
1. call returningFeval
2.
3.

What did you expect to happen? What happened instead?

Please provide any additional information below.
I use proxy.returningFeval to invoke a matlab function which returns 2 
parameters, numeric arrays. How can I get this values in JAVA?

Original issue reported on code.google.com by gomez.lo...@gmail.com on 21 Sep 2011 at 5:21

GoogleCodeExporter commented 8 years ago
I am facing the same problem . Can anyone help me?

Original comment by mehrab...@gmail.com on 8 Oct 2011 at 4:38

GoogleCodeExporter commented 8 years ago
They will be returned as linear arrays as documented 
matlabcontrol.MatlabProxy's documentation. Per the documentation:

Numeric Classes and Logical Class
All MATLAB numeric types whether they are a singular value or an array/matrix 
(of any dimension) are always converted into a one-dimensional Java double[]. 
For complex numbers, only the real component is converted. MATLAB logicals 
whether a singular value or an array/matrix (of any dimension) are always 
converted into a one-dimensional Java boolean[]. MATLAB arrays are stored in a 
linear manner, which has been documented by The MathWorks. It is in this linear 
manner that MATLAB arrays are returned to Java. (Sparse matrices are stored 
differently and are not sent to Java in an easy to use manner.) 

A future version of matlabcontrol will automatically convert these linear 
arrays in to much easier to use Java objects.

Original comment by nonot...@gmail.com on 26 Oct 2011 at 6:23