No BSD License  

Highlights from
slocdir

3.0

3.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 955 Bytes File ID: #24000

slocdir

by Diffy D

 

04 May 2009 (Updated 05 May 2009)

Go recursively into folders to count the .m lines of code

| Watch this File

File Information
Description

A simple recursive function which uses the sloc function to count the number of lines of .m code.

The sloc function can be found here : http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3900&objectType=file

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
sloc

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
05 May 2009 Diffy D

BugWarning :

at line :
 warning( strcmp( list(i).name,'file or folder skipped') );

replace by :
 warning( strcat( list(i).name,'file or folder skipped') );

it STRCAT not STRCMP

22 Mar 2011 Francois Rongère

Hi,

You should change your line :

 count = count + slocdir(strcat(directoryPath,'//',list(i).name));

by :

count = count + slocdir(fullfile(directoryPath,list(i).name));

in order your script being portable over non-windows machines...

Thanks for the file.

François.

Please login to add a comment or rating.
Updates
05 May 2009

Fix a bug, change strcmp to strcat in the warning

Tag Activity for this File
Tag Applied By Date/Time
line count files directory folder Diffy D 05 May 2009 09:25:52

Contact us at files@mathworks.com