MATLAB JAVA BUILDER DONT PLOT A GRAPHICS

조회 수: 2 (최근 30일)
gb8
gb8 2012년 9월 20일
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