声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1262|回复: 0

[混合编程] 求救builder for java

[复制链接]
发表于 2010-4-16 16:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
M文件
  1. % snDistribution.m 标准正态分布
  2. function y=snDistribution()
  3. fun='exp(-(x^2)/2)';
  4. y=int(fun,-inf,0);
  5. end
复制代码
在matlab中测试可以通过,为什么通过builder for java生产jar文件调用的时候,


import Matlab.SNDistribution;
import com.mathworks.toolbox.javabuilder.*;
public class TestMain {        
public static void main(String[] args) throws MWException{            
           Object []result=null;            
           SNDistribution snd =new SNDistribution();
           result=snd.snDistribution(1);
           System.out.println(result[0]);
           snd.dispose();
           snd=null;        
       }
}

出现如下错误:
??? Undefined function or method 'int' for input arguments of type 'char'.

Exception in thread "main" ... Matlab M-code Stack Trace ...
file C:\Documents and Settings\Duel\Local Settings\Application Data\MathWorks\mcr_cache_v78\Matlab_36C5C4F40B1C3A1A261115697D751C0E\work\snDistribution.m,name snDistribution,line at 4.
com.mathworks.toolbox.javabuilder.MWException: Undefined function or method 'int' for input arguments of type 'char'.Error in =>snDistribution.m at 4
at com.mathworks.toolbox.javabuilder.internal.MWMCR._mclFeval(Native Method)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.mclFeval(MWMCR.java:110)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.access$600(MWMCR.java:26)
at com.mathworks.toolbox.javabuilder.internal.MWMCR$5.mclFeval(MWMCR.java:908)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.mathworks.toolbox.javabuilder.internal.MWMCR$4.invoke(MWMCR.java:806)
at $Proxy0.mclFeval(Unknown Source)
at com.mathworks.toolbox.javabuilder.internal.MWMCR.invoke(MWMCR.java:509)
at Matlab.SNDistribution.snDistribution(SNDistribution.java:208)
at com.mhi.action.TestMain.main(TestMain.java:28)

[ 本帖最后由 apiter 于 2010-4-16 16:10 编辑 ]
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-13 15:04 , Processed in 0.049357 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表