need help on calculating complexity ,speed and time needed by given code
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello professionals...i need help on how to calculate the comlexity,speed and time spent on calculation of matlab code.can u plz suggest me proper method regarding this.Thanking you
댓글 수: 0
답변 (1개)
Walter Roberson
2013년 4월 12일
편집: Walter Roberson
2013년 4월 12일
There is no tool to measure complexity; you need to calculate it using formal analysis.
Time spent can be measured with tic and toc. Be warned, though, that they measure elapsed time, not CPU time. You would need to use your operating system facilities to measure cpu time. For higher precision time measurement, consider using the FEX contribution "timeit". The technical differences between "elapsed time" and CPU time can be considerable.
You cannot calculate "speed" or "performance" without some detailed operating system and hardware tools that are specific to the hardware you are using.
On modern CPUs, measuring performance of a section of code can be quite difficult and requires making a whole series of decisions about what "performance" means.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!