MATLAB JAVA BUILDER DONT PLOT A GRAPHICS

2 Ansichten (letzte 30 Tage)
gb8
gb8 am 20 Sep. 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!

Akzeptierte Antwort

gb8
gb8 am 20 Sep. 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!!

Weitere Antworten (0)

Kategorien

Mehr zu Java Package Integration finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by