フィルターのクリア

how can I accelerate the execution of a function in matlab?

1 回表示 (過去 30 日間)
Nour BS
Nour BS 2016 年 1 月 13 日
回答済み: Image Analyst 2016 年 1 月 14 日
Hello, I am working on a project that optimize the travelling salesman problem (using the Simulating Annealing algorithm). Actually my problem here is the very large computation time that take the function to show me the optimal solution.. So I wonder if there is any technique can make the matlab code execute faster?
Any help is greatly appreciated...

回答 (3 件)

John D'Errico
John D'Errico 2016 年 1 月 13 日
Some magic wand that can make it run faster? No. If there was a way to make things run faster, they would already have done it for you.
If you want speed, you need to invest the effort. And we cannot know what you need to do, since there are many ways to speed up code. After all, odds are, from your question, you are a bit of a novice. So your code is probably not that efficient. Just a guess.
You need to learn to use the profiler tool, to see where you can gain, where are the bottlenecks.
There are other things you CAN do, for example, you could use various tools to make your code run in parallel. But that requires the processors to do it, the toolbox to make it work, so a bit of money invested. You could try using a GPU processor. But again, that requires knowledge, it requires money. A person with serious skills in C as well as serious skills in numerical analysis might be able to write more efficient code.
Start with your own code. Learn to make it more efficient. By far, that is your most likely source of gain, and the simplest to achieve, as well as the cheapest solution.
  1 件のコメント
Nour BS
Nour BS 2016 年 1 月 13 日
@John D'Errico Thank you for your answer !

サインインしてコメントする。


Alan Weiss
Alan Weiss 2016 年 1 月 14 日
I would say that the way to get better speed on this problem is to avoid using the simulated annealing algorithm. The intlinprog solver is almost certainly faster and more reliable. See the documentation example.
Alan Weiss
MATLAB mathematical toolbox documentation

Image Analyst
Image Analyst 2016 年 1 月 14 日
Under the "Performance and Large Data Sets" section, there is a video on "Optimizing and Accelerating your MATLAB Code" and one on "Speeding Up MATLAB Applications"

カテゴリ

Help Center および File ExchangeGet Started with Optimization Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by