Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2013-07-31, 10:50   #1
manufacture
初级会员
 
注册日期: 2013-07-31
年龄: 35
帖子: 1
声望力: 0
manufacture 正向着好的方向发展
难过 Java中使用MATLAB作图 why 里面的弧线不显示

matlab 2010b
java version jdk1.7.0_25
________________________________
import com.mathworks.toolbox.javabuilder.*;
import plotdemo.plotter;

public class createplot {
public static void main(String[] args)
{

MWNumericArray x = null; /* Array of x values */
MWNumericArray y = null; /* Array of y values */
plotter thePlot = null; /* Plotter class instance */
int n = 20; /* Number of points to plot */

try
{
/* Allocate arrays for x and y values */
int[] dims = {1, n};
x = MWNumericArray.newInstance(dims,
MWClassID.DOUBLE, MWComplexity.REAL);
y = MWNumericArray.newInstance(dims,
MWClassID.DOUBLE, MWComplexity.REAL);

/* Set values so that y = x^2 */
for (int i = 1; i <= n; i++)
{
x.set(i, i);
y.set(i, i*i);
}

/* Create new plotter object */
thePlot = new plotter();

/* Plot data */
thePlot.drawplot(x, y);
thePlot.waitForFigures();
}

catch (Exception e)
{
System.out.println("Exception: " + e.toString());
}

finally
{
/* Free native resources */
MWArray.disposeArray(x);
MWArray.disposeArray(y);
if (thePlot != null)
thePlot.dispose();
}
}


}


why 结果出来就单单显示窗口,没有内容。
manufacture 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 20:01


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.