From: Arvind on 24 Jun 2010 17:18 Dear MATLAB and Java Experts, I am trying to export a .jar file from Eclipse that includes the Java-wrapped MATLAB code. I am relatively new to Java so please bear with me. I have used 'deploytool' to create a class 'addimage' and have added my .m file 'imadd100' which adds 100 to a single input and uses that as the output. When I reference the method in my java program, Eclipse only seems to recognize my method as an Object,Object, or List, List, or int, Object instead of the int,MWNumericArray (this format is written in the documentation for passing in arguments to the java wrapped matlab code). I get the following: Error: Unresolved compilation problem: The method imadd100(int, Object[]) in the type addimage is not applicable for the arguments (int, MWNumericArray) Any help is much appreciated! Arvind
From: Arvind on 25 Jun 2010 09:41 Just doing a quick update...I tried the old fashioned way as well through the command prompt and text files. I get the following error in the command prompt: ..\axialslicelistener.java:43: incompatible types found : java.lang.Object[] required: com.mathworks.toolbox.javabuilder.MWNumericArray result=objectadd100.imadd100(1,n); ^ 1 error Here is the relevant code: double[] n=new double[2]; n[0]=1; n[1]=2; MWNumericArray x=new MWNumericArray(n,MWClassID.DOUBLE); MWNumericArray result; addimage objectadd100 = new addimage(); result=objectadd100.imadd100(1,n); So I'm not sure if the problem is within Eclipse. I appreciate any help! "Arvind " <ab835(a)georgetown.edu> wrote in message <i00i2d$39o$1(a)fred.mathworks.com>... > Dear MATLAB and Java Experts, > > I am trying to export a .jar file from Eclipse that includes the Java-wrapped MATLAB code. I am relatively new to Java so please bear with me. I have used 'deploytool' to create a class 'addimage' and have added my .m file 'imadd100' which adds 100 to a single input and uses that as the output. When I reference the method in my java program, Eclipse only seems to recognize my method as an Object,Object, or List, List, or int, Object instead of the int,MWNumericArray (this format is written in the documentation for passing in arguments to the java wrapped matlab code). I get the following: > > Error: Unresolved compilation problem: > The method imadd100(int, Object[]) in the type addimage is not applicable for the arguments (int, MWNumericArray) > > Any help is much appreciated! > Arvind
From: Arvind on 25 Jun 2010 10:06 Oops, found a typo: > result=objectadd100.imadd100(1,n); should be > result=objectadd100.imadd100(1,x); But I still get the same error message... "Arvind " <ab835(a)georgetown.edu> wrote in message <i02blf$21v$1(a)fred.mathworks.com>... > Just doing a quick update...I tried the old fashioned way as well through the command prompt and text files. I get the following error in the command prompt: > > > .\axialslicelistener.java:43: incompatible types > found : java.lang.Object[] > required: com.mathworks.toolbox.javabuilder.MWNumericArray > result=objectadd100.imadd100(1,n); > ^ > 1 error > Here is the relevant code: > double[] n=new double[2]; > n[0]=1; > n[1]=2; > MWNumericArray x=new MWNumericArray(n,MWClassID.DOUBLE); > > MWNumericArray result; > addimage objectadd100 = new addimage(); > result=objectadd100.imadd100(1,n); > > So I'm not sure if the problem is within Eclipse. > > I appreciate any help! > > "Arvind " <ab835(a)georgetown.edu> wrote in message <i00i2d$39o$1(a)fred.mathworks.com>... > > Dear MATLAB and Java Experts, > > > > I am trying to export a .jar file from Eclipse that includes the Java-wrapped MATLAB code. I am relatively new to Java so please bear with me. I have used 'deploytool' to create a class 'addimage' and have added my .m file 'imadd100' which adds 100 to a single input and uses that as the output. When I reference the method in my java program, Eclipse only seems to recognize my method as an Object,Object, or List, List, or int, Object instead of the int,MWNumericArray (this format is written in the documentation for passing in arguments to the java wrapped matlab code). I get the following: > > > > Error: Unresolved compilation problem: > > The method imadd100(int, Object[]) in the type addimage is not applicable for the arguments (int, MWNumericArray) > > > > Any help is much appreciated! > > Arvind
|
Pages: 1 Prev: help need to knowwhat is this Error Next: Simulink model, GUI, executables and online apps? |