subs赋值太慢,大家有遇到没,进来看下啊。
<table class="t_msg" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top"><a title="评分 0" href="http://www.baisi.net/misc.php?action=viewratings&tid=1270587&pid=5059791" name="pid5059791"></a><span class="bold"><font size="3">subs赋值太慢,大家有遇到没,进来看下啊。</font></span><br/><br/><script language="JavaScript"></script><div style="FONT-SIZE: 14px;"><span style="LINE-HEIGHT: 180%;">function G=myfun(x)<br/>syms x1 x2 x3 x4<br/>t=;<br/>p=;<br/>i=;<br/>for m=1:8<br/> for n=1:9<br/>F(m,n)=(x1.*(1+x2.*log(p(m,1)))/(t(1,n)+x3).^x4-i(m,n)).^2;<br/> end<br/>end<br/>Q=sum(sum(F)); <br/>G=subs(Q,,)<br/>上面是我定义的m函数<br/>=fminsearch ('myfun', )<br/>然后用fminsearch求极小值,发现subs函数赋值太慢,有没有高手帮忙解决下啊<br/>上面的程序可以运行就是很慢。</span></div></td></tr></tbody></table> 换一台配置高的电脑,台式机CPU>3Ghz 先考虑一下,会了再回复 我觉得不用定义x1,x2,x3,x4直接用用x(1),x(2),x(3),x(4)就可,速度还行吧,一眨眼
页:
[1]