How can I obtain the total number of lines that can be run in a MATLAB file in MATLAB 7.14 (R2012a)?
6 ビュー (過去 30 日間)
古いコメントを表示
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')
採用された回答
MathWorks Support Team
2012 年 6 月 11 日
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 件のコメント
その他の回答 (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!