필터 지우기
필터 지우기

Whether ADD SEMICOLON for output will reduce execution time?

조회 수: 3 (최근 30일)
Jason
Jason 2016년 3월 8일
댓글: Star Strider 2016년 3월 8일
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?

채택된 답변

Star Strider
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
Jason
Jason 2016년 3월 8일
Great. Thank you for your detailed answer.
Star Strider
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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by