Whether ADD SEMICOLON for output will reduce execution time?
조회 수: 3 (최근 30일)
이전 댓글 표시
If my code compute data for 1 day. If I ADD SEMICOLON after the statements, means nothing display in Command Windows, does this will reduce execution time greatly?
댓글 수: 0
채택된 답변
Star Strider
2016년 3월 8일
The only way to determine that quantitatively is to time it with and without the semicolons. Adding semicolons to suppress Command Window output would speed your code. You would have to define whether it speeds it ‘greatly’. For short routines, likely not much. For long or iterated routines, likely much.
댓글 수: 4
Star Strider
2016년 3월 8일
My pleasure.
When I first started using MATLAB 20+ years ago, etime was the only option, so I got used to using it. The tic and toc functions arrived later, and are preferable.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!