MATLAB JAVA BUILDER DONT PLOT A GRAPHICS
1 次查看(过去 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!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Java Package Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!