|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
因为我想用c#编程中用到matlab,所以在尝试把.m文件做成com组件。我用的版本是matlab6.5
我在网上找了个m文件:
function test(h,D)
for x=-10:0.1:10,
if x>D
y=h;
hold on;
plot(x,y)
elseif x<-D
y=-h;
hold on;
plot(x,y)
else
y=h/(D*x);
hold on;
plot(x,y)
end
end
用com builder创建com组件的时候出错:
Error using==>comtool(build)
Error:An error occurred while shelling out to mbuild(error code=1).
Unable to build executable(specify the -v option for more information)
Building standalone executable...
mcc -M -silentsetup -d 'C:/MATLAB6p5/work/me/src' -B 'cppcom:me,me,1.0' -i C:/MATLAB6p5/bin/win32/test.m
Warning: File: c:/matlab6p5/bin/win32/test.m Line: 6 Column: 7
References to "plot" require the C/C++ Graphics Library when executing in stand-alone mode. You must specify -B sgl or -B sglcpp in order to use the C/C++ Graphics Library. Also, if using the -W option, you must specify either the mainhg or libhg wrapper type. A run-time error will occur if the C/C++ Graphics Library is not present when "plot" is called.
Warning: File: c:/matlab6p5/bin/win32/test.m Line: 10 Column: 7
References to "plot" require the C/C++ Graphics Library when executing in stand-alone mode. You must specify -B sgl or -B sglcpp in order to use the C/C++ Graphics Library. Also, if using the -W option, you must specify either the mainhg or libhg wrapper type. A run-time error will occur if the C/C++ Graphics Library is not present when "plot" is called.
Warning: File: c:/matlab6p5/bin/win32/test.m Line: 14 Column: 7
References to "plot" require the C/C++ Graphics Library when executing in stand-alone mode. You must specify -B sgl or -B sglcpp in order to use the C/C++ Graphics Library. Also, if using the -W option, you must specify either the mainhg or libhg wrapper type. A run-time error will occur if the C/C++ Graphics Library is not present when "plot" is called.
mbuild is choosing an appropriate compiler...
Modification of non-creatable array value attempted, subscript -1 at C:/MATLAB6p5/bin/win32/mexsetup.pm line 625.
请大家帮我看看是什么原因啊,谢谢大家了!!!我都弄了一天了。。。
[ 本帖最后由 wangyanyy 于 2006-8-23 16:01 编辑 ] |
|