MATLAB JAVA BUILDER DONT PLOT A GRAPHICS

2 次查看(过去 30 天)
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!

采纳的回答

gb8
gb8 2012-9-20
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!!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Java Package Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by