Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <Steven_Lord@mathworks.com>
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$1@newscl01ah.mathworks.com>
References: <lehcqg$82p$1@newscl01ah.mathworks.com> <lepfvk$qf2$1@newscl01ah.mathworks.com> <lf0smj$t0c$1@newscl01ah.mathworks.com> <lf2aag$jiq$1@newscl01ah.mathworks.com> <lf958e$1mn$1@newscl01ah.mathworks.com>
Reply-To: "Steven Lord" <Steven_Lord@mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1394117407 11227 172.28.8.241 (6 Mar 2014 14:50:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 6 Mar 2014 14:50:07 +0000 (UTC)
In-Reply-To: <lf958e$1mn$1@newscl01ah.mathworks.com>
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: news.mathworks.com comp.soft-sys.matlab:810362


"SAMEER ahamed" <sameersoft6@gmail.com> wrote in message 
news:lf958e$1mn$1@newscl01ah.mathworks.com...
> "Steven Lord" <Steven_Lord@mathworks.com> wrote in message 
> <lf2aag$jiq$1@newscl01ah.mathworks.com>...

*snip*

> 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.

http://www.mathworks.com/help/matlab/matlab_prog/integers.html

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

http://www.mathworks.com/help/matlab/using-java-libraries-in-matlab.html

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
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com