How to check in which step MATALB code is running?
53 views (last 30 days)
Show older comments
I have made a code which took approx 4-5 hours to execute.....So how could I know on which step that code is running and how much time will it take to complete ?
0 Comments
Answers (2)
Star Strider
on 25 Aug 2014
Without seeing the code it’s impossible to say exactly. However when I run long simulations (usually with at least one loop), I start a time counter with the clock function at the beginning of the program (before the start of the loop), and just prior to the ends of the main loop, I put an fprintf statement that reports what the loop counter is, uses the etime function to show how long that loop took, and another calculation of how long the entire program has been running. All that prints in the Command Window. One fprintf statement like that doesn’t slow the code down noticeably, but it can be reassuring.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!