How much time does it take for matlab to print a line in the command window
27 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a function that prints a line in the command window every time it is run. This function is run for a different number of times depending on the situation, but at maximum like 3000 times. This is why I wonder how much time it takes for matlab to actually write the line in excess of the time it takes to run the command. I Expect this operation to slow down my script quite a lot. This is a little hard to test since the program runs on a multi core processor and thus the cpu time is higher than the actual time passing. Also tic-toc does not take care to the delay due to printing.
If anyone anything about this please respond.
BR Patrik
0 个评论
采纳的回答
Jan
2013-12-20
The updates of the command window are performed in the Java level of Matlab. The execution times vary randomly and can slow down the processing remarkably.
I ran a large program with several hundred thousands line of code, which needs some seconds to execute only. When I have to start in in a batch mode for thousands of cases, the delay caused by the screen output is painful and therefore I've implemented a "fast" mode, which calls the program through evalc() and suppressed the complete output except for warning or errors. This saves 20% to 30% runtime(!) and nobody is able to read 1000*500 lines of messages at all.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!