Borrar filtros
Borrar filtros

MATLAB JAVA BUILDER DONT PLOT A GRAPHICS

2 visualizaciones (últimos 30 días)
gb8
gb8 el 20 de Sept. de 2012
good day !
Using matlab, I created a function that is the sum of two numbers and plots a graph:
The value of a is a vector of two positions, since b is a number!
Everything works except generate GRAPHIC! The application (window Matlab chart) opens up, but does not plot anything!
My java version is 1.7.05, and the machine in matlab! The version of matlab is 2009.
if true
function y = soma( a, b )
y(1) = a(1) + b;
y(2) = a(2) + b;
plot(y)
end
Then I export this function using the matlab function Deployment Tools, which exports the code for Java, C + +, C, etc. .........
Then call the function in ECLIPSE INDIGO - Java
if true
import mTeste.mTESTEClass;
import com.mathworks.toolbox.javabuilder.*;
public class teste {
/**
* Launch the application.
*/
public static void main(String[] args) {
/**
* Create the frame.
*/
mTESTEClass a = null;
MWNumericArray b = null;
MWNumericArray c = null;
Object [] result = null;
try {
a = new mTESTEClass();
double[] ex = {2,3};
b = new MWNumericArray(ex);
c = new MWNumericArray(3);
result = a.soma(1, b, c);
System.out.println(result.length);
System.out.println(result[0]);
a.waitForFigures();
} catch (MWException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
finally
{
b.dispose();
c.dispose();
MWArray.disposeArray(result);
a.dispose();
}
}
}
end
The problem I have is that the graph appears blank when the application squeegee!!
Has anyone done something similar? After much research on the www, I found nothing that resembles my problem!

Respuesta aceptada

gb8
gb8 el 20 de Sept. de 2012
Solved!
My version of java was 7, and it seems to be a bug in JAVA!
I returned to the latest version of java 6, and it worked!!

Más respuestas (0)

Categorías

Más información sobre Java Package Integration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by