How do you return computational time and memory allocated during function call?

I am trying to save the computational time and memory allocated during a function call to two variables (that can then be saved to a text file). How do I return both, as well as the normal output of my function, when calling my function?

답변 (1개)

Star Strider
Star Strider 2025년 2월 28일
There are a few functions you can use for timing, one of which is the tic, toc pair. Most current recommendations are to use duration arrays for this, although in the past, using clock and etime were appropriate.
For memory usage, the memory and inmem funcitons are available.
There may be File Exchange contributions that could do what you want, so search there as well.
.

카테고리

도움말 센터File Exchange에서 Performance and Memory에 대해 자세히 알아보기

제품

릴리스

R2023b

태그

질문:

2025년 2월 28일

답변:

2025년 2월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by