how to count uncommented ligns in matlab file?
Mostra commenti meno recenti
Hi,
I would like to count the number of ligns of code I produced for a project.
But I don't want to count commented ligns in the file. Otherwise I know I can use the function suggested (here).
Moreover sometimes the first character is not the (%) and there are some blank spaces before
Does anyone have an idea?
Thanks a lot.
Risposta accettata
Più risposte (1)
Image Analyst
il 2 Apr 2023
0 voti
You can use my comment counter program, attached.
3 Commenti
Adam Danz
il 2 Apr 2023
Would this be a good candidate for the file exchange (I haven't looked at it yet)?
There's still this thing that I built off comment_counter.m to add support for legacy versions and some other features.
This all comes from a conversation here:
thispath = fullfile(matlabroot,'toolbox/images/colorspaces/');
checkcomments('path',thispath,'direction','ascend','countblank','recursive')
Rik gets credit for the core code that actually finds the comments. If all one needs to do is isolate comments from non-comments, then that's really what they need. See checkcommProcessor() and Rik's minify code on the FEX.
Adam Danz
il 3 Apr 2023
Wow, that looks useful!
Categorie
Scopri di più su BeagleBone Black in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!