This following does work:
helper=@(f) f.listFiles(org.apache.commons.io.filefilter.WildcardFileFilter('*.dat'))
length_func = @(d) length(helper(java.io.File(d)))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!