声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1313|回复: 6

[混合编程] 请教 eight(八)的问题~请诸位大侠多多指点阿~

[复制链接]
发表于 2006-10-12 16:32 | 显示全部楼层 |阅读模式

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

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

x
文件夹里有7个文件,其中non.m是我自己写的,使用拉fmincon函数~
其余六个是matlab自带的文件~
把它放到都一个文件夹里~
在wokspacez中输入初始值~

Aeq=[ 0.5878 0.7405 0.7953 0.1760 -0.1652;
      0.7925 0.1322 -0.5317 -0.9827 0.8718;
      -0.1623 -0.6963 -0.2908 0.0573 0.4611];

再运行non(Aeq)
就可的结果拉~

但在matcom中总有错~

我把缺少的文件加进去,他又说少别的~越加越多阿,没完啦~

恳请大侠指点阿~
谢谢阿~


错误如下~
籈rror D:\program\matlab7.1\work\fmincon.m 138: 'switch optimget(options,'Display',defaultopt,'fast')'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 168: 'mtxmpy = optimget(options,'HessMult',defaultopt,'fast');'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 177: 'diagnostics = isequal(optimget

(options,'Diagnostics',defaultopt,'fast'),'on');'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 178: 'gradflag =  strcmp(optimget

(options,'GradObj',defaultopt,'fast'),'on');'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 179: 'hessflag = strcmp(optimget

(options,'Hessian',defaultopt,'fast'),'on');'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 185: 'gradconstflag =  strcmp(optimget

(options,'GradConstr',defaultopt,'fast'),'on');'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 186: 'line_search = strcmp(optimget

(options,'LargeScale',defaultopt,'fast'),'off'); % 0 means trust-region, 1 means line-search'
'optimget' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 276: 'XOUT = startx(u,l);'
'startx' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 368: 'if findstr(xlate('Too many output arguments'),lasterr)'
'xlate' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 376: 'errmsg = sprintf('%s%s%s\n%s%s', ...'
'func2str' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 450: 'msg = diagnose

('fmincon',OUTPUT,gradflag,hessflag,constflag,gradconstflag,...'
'diagnose' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 481: '[X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN] = ...'
'sfminbx' was not found. Please debug the code.

Error D:\program\matlab7.1\work\fmincon.m 481: '[X,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN] = ...'
argument internal error
回复
分享到:

使用道具 举报

发表于 2006-10-12 16:44 | 显示全部楼层
原帖由 heavymetalcu 于 2006-10-12 16:32 发表
文件夹里有7个文件,其中non.m是我自己写的,使用拉fmincon函数~
其余六个是matlab自带的文件~
把它放到都一个文件夹里~
在wokspacez中输入初始值~

Aeq=[ 0.5878 0.7405 0.7953 0.1760 -0.1652;
      0.7 ...


你要使用matcom方式,并且使用工具箱的话,就只能一个一个添加进去,反正我当时也是这样做的,缺哪个加哪个,如果你想省点功夫,就在matlab中调试跟踪 non(Aeq),看它具体运行哪些代码,只把这些代码保留,其他删掉,就ok了,不过记得备份你的matlab自带文件,呵呵

评分

1

查看全部评分

 楼主| 发表于 2006-10-12 16:48 | 显示全部楼层

你要使用matcom方式,

我明白你的意思~
还有一个问题~
如果运行成功地话,在matcom/debug下会生成很多的文件,(每一个m文件都会生成H和cpp文件~)
我要把这些文件都加入都我的VC工程里面么??
发表于 2006-10-12 16:53 | 显示全部楼层
原帖由 heavymetalcu 于 2006-10-12 16:48 发表
我明白你的意思~
还有一个问题~
如果运行成功地话,在matcom/debug下会生成很多的文件,(每一个m文件都会生成H和cpp文件~)
我要把这些文件都加入都我的VC工程里面么??



在C++ builder中:

把Debug目录下所有文件拷贝到VC工程目录下(我也不清楚哪些是需要的,哪些是不需要的,没有测试过,反正全部拷贝就肯定不错),然后在主文件(A.cpp或A.h)添加语句#include “A.cpp”,另外,要把用到的所有cpp文件(除了脚本那个,即除了A.cpp和g_A.cpp,后者matcom编译后自动生成)添加到当前工程中。
 楼主| 发表于 2006-10-12 16:59 | 显示全部楼层
还有一个问题请指教~~
我在matcom编译的过程中,matcom告诉我我缺了哪个m文件,我就去搜索拉~
结果搜到很多同名的m文件(不在相同的目录下)
我该如何选择呢??
发表于 2006-10-12 17:01 | 显示全部楼层
原帖由 heavymetalcu 于 2006-10-12 16:59 发表
还有一个问题请指教~~
我在matcom编译的过程中,matcom告诉我我缺了哪个m文件,我就去搜索拉~
结果搜到很多同名的m文件(不在相同的目录下)
我该如何选择呢??



在matlab中跟踪调试吧,看看它调用哪个
 楼主| 发表于 2006-10-12 17:04 | 显示全部楼层

感谢eight(八)~~~~~

好的,我试试~
有问题再请教你~
今天一定要做出来~
感谢eight(八)~~~~~
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-6-6 11:04 , Processed in 0.055681 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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