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

Dyuman Joshi
Dyuman Joshi 2023년 9월 7일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Computational Fluid Dynamics (CFD)에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2023년 9월 7일

댓글:

2023년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by