QQ登录

只需要一步,快速开始

 注册地址  找回密码

tag 标签: function

相关帖子

版块 作者 回复/查看 最后发表
用SAS实现商业周刊经典风格 对绘图背景进行隔行填色 attach_img SAS论坛 厚积薄发 2011-6-7 11 8864 空木葬花 2014-8-16 17:07
灰色预测Matlab 程序 attachment 灰色算法 kelimasa 2011-12-15 26 16523 PER. 2014-2-14 15:22
数学名词站 attach_img 数学基础 lilianjie 2011-12-27 13 8134 空木葬花 2014-3-13 17:22
导数(derivative function) 全国大学生数学竞赛 YShangJ 2012-2-8 3 5001 YShangJ 2012-2-8 20:59
ERROR: 目录“SASHELP.DMINE”不存在。 SAS论坛 pinky_0211 2012-2-16 0 5461 pinky_0211 2012-2-16 15:59
悬赏 下载了《精通MATLAB最优化计算》书上的优化程序,用它来做杆机构的优化,我的目标函.. - [悬赏 10 点体力] 最优化算法 changfeng1937 2012-2-27 2 5239 changfeng1937 2012-2-27 14:51
Matlab遗传算法工具箱问题!求指导! (求来个大神解答吧。。。) 遗传算法 叹息的烤鱼 2012-4-24 1 4095 一杯沧海 2012-4-25 22:34
悬赏 遗传算法交叉函数的疑问 - [悬赏 9 点体力] MATLAB论坛 gyf3266296 2012-5-5 1 2656 gyf3266296 2012-5-5 15:05
急需求助 灰色模型 灰色算法 1530568658 2012-5-6 2 18752 wuzhenhua 2014-6-6 15:36
matlab菜鸟求指教 Matlab 资料库 视频 教程 讲义 代码 xuzf 2012-5-20 6 1885 zhen宇 2012-5-21 21:43
悬赏 求:用MATLAB求自相关系数 - [悬赏 2 点体力] Matlab 资料库 视频 教程 讲义 代码 梓爱 2012-7-13 3 8298 zjqylcy 2012-7-16 10:49
请高手指教,这题是什么意思,怎么解?拜谢!! 建议交流区 遗忘角落 2012-7-18 3 2389 遗忘角落 2012-7-18 21:17
关于积分的一个问题 attach_img 最优化算法 在仰望星空 2012-10-6 3 3153 hehainan86 2012-10-8 17:31
悬赏 为什么我的MATLAB中国trainwh语句不能使用? - [悬赏 20 点体力] 数模问题互助 mathhgr 2012-11-24 4 2853 mathhgr 2012-11-29 22:00
最大流通用函数问题。 图论算法 晒个小太阳。 2013-1-20 0 2668 晒个小太阳。 2013-1-20 17:40
悬赏 matlabd的fsolve函数求解方程组 - [悬赏 2 点体力] 算法类综合讨论版 追梦人1101 2013-1-26 2 10196 2249039642 2017-11-12 16:49
关于图论的广度优化搜索,语句while~isempty(g==1)正确吗? 图论算法 ganquanlife 2013-3-2 2 3545 madio 2013-3-2 21:34
悬赏 求助关于求图割点的代码,哪里错了?怎么改正啊? - [悬赏 2 点体力] 图论算法 ganquanlife 2013-3-3 1 6339 ganquanlife 2013-3-3 15:03
matlab function函数的编写教程很实用 attachment Matlab 图像处理 视频流处理 大波波 2013-5-26 0 2067 大波波 2013-5-26 12:25
这。。。求救,这怎么办。。。? 数模经验分享 wangkai2013 2013-7-18 0 1632 wangkai2013 2013-7-18 20:37

相关日志

分享 真是不容易啊
angelyork 2014-5-16 00:28
为了能下载禁忌搜索的书,写了这个,加体力 (function(w, d, g, J) { var e = J.stringify || J.encode; d = d || {}; d = d || function() { w.postMessage(e({'msg': {'g': g, 'm':'s'}}), location.href); } })(window, document, '__huaban', JSON);
0 个评论
分享 一星期掌握MAPLE?
tireswing 2013-10-4 19:42
老师大概给了一星期的时间掌握MAPLE,然后跟实验室的人讲。怎么才能最快的掌握呢? (function(w, d, g, J) { var e = J.stringify || J.encode; d = d || {}; d = d || function() { w.postMessage(e({'msg': {'g': g, 'm':'s'}}), location.href); } })(window, document, '__huaban', JSON);
个人分类: 碎碎念|0 个评论
分享 bnb20工具箱版
子夜虚竹 2013-7-24 17:49
bnb20工具箱版本比较老,很多地方与Maltab新版本不兼容,甚至没法使用,不建议一般用户使用 附件中提供了4个版本的Matlab中的bnb20函数,第一个是5.3版本的(提供了GUI界面,而其他三个没有),建议下载最新版本的bnb_ml70.rar 该工具箱的主要功能是完成,一般非线性整数规划 在实际应用着经常需要求解非线性整数规划或混合规划问题,该领域中的一种常用的算法是分支定界(branch and bound)算法,但是matlab工具箱中没有相关的函数。荷兰Groningen大学的Koert Kuipers编写的的BNB20工具箱可以用来求解一般非线性整数规划问题。 % BNB20 Finds the constrained minimum of a function of several possibly integer variables. % Usage: = % BNB20(fun,x0,xstatus,xlb,xub,A,B,Aeq,Beq,nonlcon,settings,options,P1,P2,...) % % BNB solves problems of the form: % Minimize F(x) subject to: xlb = x0 =xub % A*x = B Aeq*x=Beq % C(x)=0 Ceq(x)=0 % x(i) is continuous for xstatus(i)=0 % x(i) integer for xstatus(i)= 1 % x(i) fixed for xstatus(i)=2 注意:在使用该工具箱之前请保证安装了优化工具箱,由于该工具箱需要调用Matlab中的fmincon函数 下面给出一个例子说明bnb20的使用方法 对著名的Rosenbrock函数稍加修改,使得下面的方程 %===================================主调函数=================================== %一般非线性整数型优化问题 %bnb20工具箱优化工具箱使用实例说明 %建议使用最新版本的,老版本会出现不兼容 %平台Matlab7.6 for windows %使用程序bnb20_7.0 clc clear disp('按任意键开始执行') pause(); display('正在求解........') %目标函数,注意必须是字符串(就是M函数名),不支持inline和@()函数 objfun= 'objfun'; %初值,必须是列向量 x0= '; %变量类型,0为实数,1为整数,2为常数 xstatus= '; %边界,必须和x0具有相同的size,同时如果说变量的类型是整数,那么对应的边界也必须是整数,即使给出的边界不是,也要将它改为最近的整数 xlb= -100* '; xub= 100* '; %线性不等式约束 A= ; %线性等式约束 Aeq = ; %非线性约束,必须是字符串 nonlcon= 'nonlcon'; %相关一些设置,具体看说明 settings= = bnb20(objfun,x0,xstatus,xlb,xub,A,b,Aeq,beq,nonlcon,settings,options) %调用优化工具箱验证下 = fmincon(objfun,x0,A,b,Aeq,beq,xlb,xub,nonlcon,options) %===================================bnb20工具箱的运行结果=================================== Branch and Bound completed time elapsed: 0.1 secs total cycles: 9 cycles cycles failed: 0 cycles response value at optimum: 9.8479e+000 optimum design points for subproblem: 1.4181 2.0000 errmsg = '' Z = 9.8479 X = 1.4181 2.0000 t = 0.1247 c = 10 fail = 0 %===================================优化工具箱的运行结果=================================== x = 1.5434 2.3705 fval = 9.0791 exitflag = 1 output = iterations: 8 funcCount: 39 lssteplength: 1 stepsize: 1.5650e-006 algorithm: 'medium-scale: SQP, Quasi-Newton, line-search' firstorderopt: 5.8883e-007 constrviolation: 3.3005e-012 message: %注意到了,两个工具箱的运行结果不一样,这是因为我们在bnb20中设置x2必须是整数,可是优化工具箱中没有如此限制 复制代码%===================================目标函数=================================== function f=objfun(x) f=100.*(x(2)-x(1).^2).^2+(4.5543-x(1)).^2; 复制代码%===================================非线性约束=================================== function = nonlcon(x) %nonlinear inequality constraints c = -8.63*x(1)+x(2)^3; %nonlinear equality constraints ceq=[]; 复制代码
个人分类: matlab|691 次阅读|0 个评论
分享 matlab gui的使用有关操作
fshxmb1991 2012-8-24 22:50
列表框和“ Apply ”按键配合的回调函数 Myapply.m function Myapply vlist=get(findobj(gcf, 'Tag' , 'Listbox1' ), 'value' ); % 获得选项位置向量 liststr={ 'grid on' , 'box on' , 'hidden off' , 'axis off' }; % 列表框选项内容 invstr={ 'grid off' , 'box off' , 'hidden on' , 'axis on' }; % 列表框的逆指令 vv=zeros(1,4);vv(vlist)=1; for k=1:4 if vv(k);eval(liststr{k}); else eval(invstr{k}); end % 按列表选项影响图形 end ( 3 )动态编辑框的回调函数 Myedit.m function Myedit ct=get(findobj(gcf, 'Tag' , 'EditText1' ), 'string' ); eval(ct')
495 次阅读|0 个评论
分享 MATLAB实现最速下降法
姚明宇 2011-9-7 19:44
这个程序是一本美国的数值方法教材上提供的,程序清单如下: function =grads(F,G,P0,maxl,delta,epsilon,show) %input-Fistheobjectfunctioninputasstring'F' %-G=(-1/norm)(gradF)*gradF;thesearchdirection %inputasastring'G' %-P0istheinitialstratingpoint %-maxlisthemaximumnumberofinterctions %-deltaisthetoleranceforthehmininthesingle %parameterminuizationinthesearchdirection %-epsilonisthetolerancefortheerroriny0 %-show;ifshow==1theiterationsaredisplay %Output-P0isthepointofminium %-y0isthefunctionvalueF(P0) %-erriserrorboundfory0 %-Pisavectorcontainingtheiterations ifnargin==5,show=0;end =size(P0); maxj=10;big=1e8;h=1; P=zeros(maxj,n+1); len=norm(P0); y0=feval(F,P0); if(len1e4),h=len/le4;end err=1;cnt=0;cond=0; P(cnt+1,:)= ; while(cntmaxlcond~=5(hdelta|errepsilon)) %Computesearchdirection S=feval(G,P0); %Startsingleparameterquadraticminimization P1=P0+h*S; P2=P0+2*h*S; y1=feval(F,P1); y2=feval(F,P2); cond=0;j=0; while(jmaxjcond==0) len=norm(P0); if(y0y1) P2=P1; y2=y1; h=h/2; P1=P0+h*S; y1=feval(F,P1); else if(y2y1) P1=P2; y1=y2; h=2*h; P2=P0+2*h*S; y2=feval(F,P2); else cond=-1; end end j=j+1; if(hdelta),cond=1;end if(abs(h)big|lenbig),cond=5;end end if(cond==5) Pmin=P1; ymin=y1; else d=4*y1-2*y0-2*y2; if(d0) hmin=h*(4*y1-2*y0-2*y2)/d; else cond=4; hmin=h/3; end %constrcuctthenextpoint Pmin=P0+hmin*S; ymin=feval(F,Pmin); %Determinemagitudeofnexth h0=abs(hmin); h1=abs(hmin-h); h2=abs(hmin-2*h); if(h0h),h=h0;end if(h1h),h=h1;end if(h2h),h=h2;end if(h==0),h=hmin;end if(hdelta),cond=1;end %Terinationtestforminization e0=abs(y0-ymin); e1=abs(y1-ymin); e2=abs(y2-ymin); if(e0~=0e0err),err=e0;end if(e1~=0e1err),err=e1;end if(e2~=0e2err),err=e2;end if(e0==0e1==0e2==0),err=0;end if(errepsilon),cond=2;end if(cond==2hdelta),cond=3;end end cnt=cnt+1; P(cnt+1,:)= ; P0=Pmin; y0=ymin; end if(show==1) disp(P); end
351 次阅读|0 个评论
qq
收缩
  • 电话咨询

  • 04714969085

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-4-10 01:44 , Processed in 0.334360 second(s), 28 queries .

回顶部