Filter löschen
Filter löschen

Whether ADD SEMICOLON for output will reduce execution time?

3 Ansichten (letzte 30 Tage)
Jason
Jason am 8 Mär. 2016
Kommentiert: Star Strider am 8 Mär. 2016
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?

Akzeptierte Antwort

Star Strider
Star Strider am 8 Mär. 2016
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 Kommentare
Jason
Jason am 8 Mär. 2016
Great. Thank you for your detailed answer.
Star Strider
Star Strider am 8 Mär. 2016
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by