From: "Steven Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How Coordinates form Array List with comma
Date: Thu, 6 Mar 2014 09:50:12 -0500
Organization: MathWorks
Lines: 51
Message-ID: <lfa1uv$aur$>
References: <lehcqg$82p$> <lepfvk$qf2$> <lf0smj$t0c$> <lf2aag$jiq$> <lf958e$1mn$>
Reply-To: "Steven Lord" <>
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: 1394117407 11227 (6 Mar 2014 14:50:07 GMT)
NNTP-Posting-Date: Thu, 6 Mar 2014 14:50:07 +0000 (UTC)
In-Reply-To: <lf958e$1mn$>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: comp.soft-sys.matlab:810362

"SAMEER ahamed" <> wrote in message 
> "Steven Lord" <> wrote in message 
> <lf2aag$jiq$>...


> Than's for reply me , now i want to pass vector /matrices values to Java 
> method argument List<Integer> points ?
> On Matlab-side :
> matrix =[22,11,3,2,1,1,2,1];%1-by-8 matrix
> outputString = sprintf('%d,',  handles.matrix);
>    outputString = sprintf('[%s\b]', outputString);
>    disp(outputString); import edu.lipreading.*;
>    training = MainMethod;
>    training.list_method(outputString);
> %Here [22,11,3,2,1,1,2,1] these values need to pass Java Method but i got 
> error like signature class method mismatch?
> On Java Side:
> public static  void list_method(List<Integer> points){
> recordedSample.getMatrix().add(points); //Sample Class object }

The Java method is defined to accept a List object. You're attempting to 
pass it a MATLAB char array. I _believe_ Java methods that accept a 
java.lang.String can accept a MATLAB char array in its place (and that 
conversion takes place automatically), but you're trying to make applesauce 
with a basket of oranges.

Construct a Java List object using your matrix and pass that List object 
into the method. You may need to convert the double array named matrix into 
an integer array using one of the integer functions.

If you're not sure how to construct the Java List object, see the third, 
fifth, and sixth Concepts on this documentation page:

Also refer to the documentation for the Java List class on Oracle's website.

If you encounter difficulties, please reply to THIS THREAD rather than 
creating a sixth thread for this same question or contact Technical Support.

Steve Lord
To contact Technical Support use the Contact Us link on