I need to speed up my code

6 visualizaciones (últimos 30 días)
Mat Hunt
Mat Hunt el 7 de Sept. de 2023
Comentada: Dyuman Joshi el 7 de Sept. de 2023
I have code that works perfectly fine, but is very slow. I need to understand how to speed it up. I've run the profiler and there seems to be an issue with one of my functions that I wrote. This is a prototype code and I will need to change out the function zeta, as it's essentially a constitutive relation, so ideally, I will need to change it for different materials.
What can I do to speed up the code?
  1 comentario
Dyuman Joshi
Dyuman Joshi el 7 de Sept. de 2023
From a quick glance over your code -
1> Add comments in your code. It's difficult to understand what you are trying to do without any relevant information.
2> Avoid using global. Pass the variables to the local functions as inputs.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Computational Fluid Dynamics (CFD) en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by