How to profile certain selected lines of .m script file ?
Show older comments
Say the script contains 1000 lines of code. I need to profile the last 400 lines. How can I achieve this ?
Can I put those 400 lines in a separate function and passing all the variables (many huge matrices) it needs, as arguments to that function ?
1 Comment
Rik
on 18 Dec 2017
Why can't you profile the whole thing and then only look at the last part? 1000 lines seems a bit excessive for a script. It is usually better for performance and readability to split long functions and scripts into smaller parts. Having a smaller function also means that you can look at only the sub-analysis for that specific function.
Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!