How can i make my MATLAB code to run faster or robust while having many function calls and for loop up to thousands?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am doing my simulations in Matlab and my loop goes up to 5000 and there are many function calls due to which my simulations get more time I want to make my simulations robust and fast because I have to these simulations up to 10,000.
1 comentario
Jan
el 24 de En. de 2018
What kind of answer do you expect? The readers cannot suggest to enable a magic RunFaster flag and robustness is controlled completely by the programmer. Of course the readers can post suggestions to write efficient and reliable code, but there are hundreds of very important and useful hints. We cannot teach you software engineering in the forum.
The values 5000 and 10'000 are meaningless as long as you do not explain, what you are doing and what you want to improve. If runtime is the problem, use the profiler to find the bottlenecks of your code. Then post the relevant part of the code and some example inputs. With this, there is a chance that the forum can help you to improve the code.
Respuestas (1)
Jim Riggs
el 24 de En. de 2018
There is one blanket method which will speed up any Matlab code - use the Matlab compiler to generate an executable (.exe) file.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!