필터 지우기
필터 지우기

matlabFunction very slow

조회 수: 4 (최근 30일)
Martin
Martin 2011년 7월 29일
Hi,
I am using the symbolic math toolbox to generate analytical derivatives of single valued function in approximately 190 unknowns. This works all fine (within 3 min). However, if I use matlabFunction to generate an m-file consisting of the first-order conditions, this actually takes hours... I am even more concerned by the fact that the cpu-usage is only around 0.2 percent (I have eight cores, so it would be still below 2 percent for one core).
Why is matlabFunction so slow compared to fprintf? Is it just because it tries to optimize the output? Why does matlabFunction use only a negligible fraction of the cpu?
Thanks for your answers, Best, Martin
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 7월 29일
Related: http://www.mathworks.com/matlabcentral/answers/12491-why-is-matlabfunction-so-slow

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

답변 (2개)

the cyclist
the cyclist 2011년 7월 29일
What is the memory usage like? If you need to use virtual memory, the whole thing will slow down dramatically.

Martin
Martin 2011년 7월 29일
Actually, it uses virtual memory in a modest way. That was my first thought as well. This should not be the problem: matlabFunction is always quite slow even for small functions. Is there a way to write the function unoptimized?

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by