Rank: 1472 based on 59 downloads (last 30 days) and 4 files submitted
photo

Richard Moore

E-mail

Personal Profile:
Professional Interests:
cool tapes

 

Watch this Author's files

 

Files Posted by Richard View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Apr 2013 DirSize Determine the size of a folder/directory in bytes, including all subdirectories. Author: Richard Moore directory size 12 2
15 Apr 2013 ShowStructTree.m Display the fields of a structure as a tree. Author: Richard Moore struct, structure, struct contents, structure contents, tree 16 1
15 Apr 2013 EarTraining.m This is a test to develop proficiency at pitch recognition, to help a person develop perfect pitch Author: Richard Moore perfect pitch, ear training, pitch recognition, pitch identification 19 0
15 Apr 2013 tetris This is a very short (~50 line) and simple tetris game. Author: Richard Moore tetris, game 12 0
Comments and Ratings by Richard
Updated File Comments Rating
17 Apr 2013 DirSize Determine the size of a folder/directory in bytes, including all subdirectories. Author: Richard Moore

Thanks for reviewing my code and suggesting improvements, Jan. I've just uploaded a revision that addresses all of your concerns except for the directory movements. I'll play with those a bit later.

Comments and Ratings on Richard's Files View all
Updated File Comment by Comments Rating
17 Apr 2013 DirSize Determine the size of a folder/directory in bytes, including all subdirectories. Author: Richard Moore Moore, Richard

Thanks for reviewing my code and suggesting improvements, Jan. I've just uploaded a revision that addresses all of your concerns except for the directory movements. I'll play with those a bit later.

17 Apr 2013 ShowStructTree.m Display the fields of a structure as a tree. Author: Richard Moore Simon, Jan

There is no need to use the evil EVAL! "Dynamic fieldnames" work for over 10 years now:

a.b = 15
s = 'b'
disp(a.(s))

17 Apr 2013 DirSize Determine the size of a folder/directory in bytes, including all subdirectories. Author: Richard Moore Simon, Jan

You omit the first two replies from the DIT command hoping, that they are '.' and '..', but this is not a documented feature. It would be safer to check these names explicitly.
Instead of changing the current directory and using "dir", you could create the new folder names and use "dir(dirIn)" instead.
"isdir(a(x).name)" is much slower than "a(x).isdir", because DIR replies the information already.
FULLFILE is safer than "[dirIn '\' a(x).name]": E.g. dirIn can contain a trailing file separator already, e.g. C:\, and FULLFILE would care about the file separator for different operating systems also.

Most of all a help text would be a valuable improvement. Even ths usage of this function is not complicated, using this function in the real life requires that "help DirSize" replies a useful help. See Matlab's own functions or other functions in the FEX for the style of documentation Matlab users are accustomed to.

Top Tags Applied by Richard
directory size, ear training, game, perfect pitch, pitch identification
Files Tagged by Richard View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
18 Apr 2013 DirSize Determine the size of a folder/directory in bytes, including all subdirectories. Author: Richard Moore directory size 12 2
15 Apr 2013 ShowStructTree.m Display the fields of a structure as a tree. Author: Richard Moore struct, structure, struct contents, structure contents, tree 16 1
15 Apr 2013 EarTraining.m This is a test to develop proficiency at pitch recognition, to help a person develop perfect pitch Author: Richard Moore perfect pitch, ear training, pitch recognition, pitch identification 19 0
15 Apr 2013 tetris This is a very short (~50 line) and simple tetris game. Author: Richard Moore tetris, game 12 0

Contact us