Help speed up this inner loop
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I'm looking for notation, functions, and other ways to speed up this inner loop of some code that is executed many, many times for different values of Ri,Ii:
z = complex(Ri,Ii);
for (k=1:50)
e1 = eval(formula);
e2 = eval(derivative);
z = z - e1/e2 / (1 - (e1*eval(derivative2))/(2*power(e2,2.0)));
g = power(real(z),2)+power(imag(z),2);
if (k>1 && abs(g-gprev)<epsilon)
break;
end
gprev = g;
end
Is there anything I should be using to make this go faster? I know eval() should be subs() but that seems to make it waaay slower. Is there a better way to do the calculations or anything else to speed this up?
0 件のコメント
回答 (1 件)
Star Strider
2020 年 4 月 25 日
0 投票
0 件のコメント
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!