Olá a todos, estou utilizando o matlab builder JA para gerar um jar. Comecei a seguir a documentação do help do matlab referente a esta parte.
Estou utilizando o seguinte example contido em C:\Program Files\MATLAB\R2008b\toolbox\javabuilder\Examples\MagicSquareExample
Neste exemplo existe uma classe chamada getmagic que contém uma simples main instanciando a classe gerada pelo matlab.
Quando abro este arquivo no eclipse sem alterar em nada o exemplo contido no arquivo exibe a seguinte mensagem:
The method makesqr(int, Object[]) in the type magic is not applicable for the arguments (int, MWNumericArray)
Alguém já teve esse problema antes ou sabe como posso resolver isso?
Em anexo coloquei a minha pasta contendo o meu arquivo .m e o jar gerado no matlab para se importado
Grata,
Informações adicionais:
windows 7 professional
matlab r2008b
Eclipse SDK
Version: 3.2.1
Build id: M20060921-0945
/* getmagic.java
* This file is used as an example for the MATLAB
* Builder JA product.
*
* Copyright 2001-2007 The MathWorks, Inc.
*/
/* Necessary package imports */
import com.mathworks.toolbox.javabuilder.*;
import magicsquare.*;
/*
* getmagic class computes a magic square of order N. The
* positive integer N is passed on the command line.
*/
class getmagic
{
public static void main(String[] args)
{
MWNumericArray n = null; /* Stores input value */
Object[] result = null; /* Stores the result */
magic theMagic = null; /* Stores magic class instance */
try
{
/* If no input, exit */
if (args.length == 0)
{
System.out.println("Error: must input a positive integer");
return;
}
/* Convert and print input value*/
n = new MWNumericArray(Double.valueOf(args[0]),MWClassID.DOUBLE);
System.out.println("Magic square of order " + n.toString());
/* Create new magic object */
theMagic = new magic();
/* Compute magic square and print result */
result = theMagic.makesqr(1,n);
System.out.println(result[5]);
}
catch (Exception e)
{
System.out.println("Exception: " + e.toString());
}
finally
{
/* Free native resources */
MWArray.disposeArray(n);
MWArray.disposeArray(result);
if (theMagic != null)
theMagic.dispose();
}
}
}