フィルターのクリア

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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by