How can I obtain the total number of lines that can be run in a MATLAB file in MATLAB 7.14 (R2012a)?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I use the MATLAB Profiler to calculate the code coverage of the executed code.
I can use the following command and parse the data in the 'stats' structure to see which lines actually ran during execution. However, in order to calculate the coverage, I need to know how many lines of code could actually run in each function. I see this data in the MATLAB Profiler GUI as "Code lines (lines that can run)", but this information is not part of the stats structure.
Is there any way of obtaining this data either in the profiler or through another tool?
stats = profile('info')
Risposta accettata
MathWorks Support Team
il 11 Giu 2012
The ability to return the number of lines that can be run using the MATLAB Profiler is not available in MATLAB.
To work around this issue you may use the file 'countlines.m' that is provided with the solution to count the number of lines in a MATLAB file.
countlines(<filename>)
The following calling syntax may be used to count the total number of lines of code in all of the MATLAB code files in the current working directory:
countlines('all')
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!