Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Help for optimizing a code

1 回表示 (過去 30 日間)
Stéphane
Stéphane 2014 年 11 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi
I'm trying to optimize a code with nested for loops (originally written in another language ), and I try to get it in the proper "matlab" form... I've already asked many questions in this forum but now I don't know if I'm going the proper way or not. I've attached to this post a m file with the original loops, and the way I think optimized...
Could anyone of you have a look and tell me if it's just rubbish or if I'm going the good way ?
Thanks...
  5 件のコメント
Geoff Hayes
Geoff Hayes 2014 年 11 月 17 日
Stéphane - does your testLoop.m code contain the small matrix that takes a really long time to evaluate? When I ran the attached, tic and toc indicated that the elapsed time was 0.056486 seconds which is pretty quick…
Note that there did seem to be some differences between dm and dm2. Have you observed the same?
Stéphane
Stéphane 2014 年 11 月 18 日
That's the problem when change a code without carrefully checking...
I've uploaded a slighty different version, differences are on the edges (if I'm not mistaken) but I don't use them.
The time is indeed of 0.056 sec for the "no-loop" version, but I need to use this function 10^6 times for now, and I'll have to increase the matrices dimension by a factor at least 100... So you can imagine that any split second save would be great...
Thanks for your help :-)
Stéphane

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by