Problem 844. Find files with extension ext in the current directory
List all files with extension 'ext' in the current directory. Return a char matrix with the name of files in rows. Return 0 if no files.
Solution Stats
Problem Comments
-
4 Comments
The problem can't run because the Test Suite issues mkdir; cd test.
The call to filerep.m is no longer on the path. Suggest eliminate mkdir and cd lines.
The mkdir test; and cd test issue makes it impossible to make any submissions.
Sorry. It's OK now.
My answer 15 is Donkey. Did just to show test Suite could be gamed. Also did not know how to get dir *.ext, which was frustrating me as I left out the ()s. Suggest add a fn=['saveme.mat' num2str(randi(9,1,1))] and then do your save fn with ext=fn(8:11). Then rescore solution 15. This will cut out the cheats. Good problem update of addpath. The Test Suites are more complex than the solutions sometimes.
Solution Comments
Show commentsProblem Recent Solvers33
Suggested Problems
-
10024 Solvers
-
Project Euler: Problem 3, Largest prime factor
1431 Solvers
-
119 Solvers
-
Arrange vector in ascending order
775 Solvers
-
Calculate the derivative of a polynomial
228 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!