How to decrease the execution time in Matlab ?

10 次查看(过去 30 天)
Hello,
I am wondering if there is a way to speed up the computation time of specific function, such as step or bode in matlab ? If one work with large scale systems, these computations can be quite long.
I tried to look at the parallel computing toolbox but I am not sure if this could help.
Thank you for any help your answer !

采纳的回答

Jan
Jan 2017-10-2
No, there is no magic "run faster" setting.
Some algorithms can be parallelized by parfor. Sometimes this does not help, e.g. if all cores are on load already by multi-threading: FFT, SUM and many other commands distribute the work to multiple threads already, such that the available cores are used. Then there is no additional resource left to process in parallel.
You can improve the code e.g. by avoiding repeated calculations, reducing the number of expensive functions (e.g. by writing 1e5 instead of 1*10^5) and by processing the data in column-wise order (then they are neighboring elements in RAM and the processing is faster). There are many more methods to accelerate algorithms and Matlab code. Use the profiler to find the bottleneck of the code and then post it here to get specific suggestions.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by