Cody

# Problem 43025. Check if a directory is on the current MATLAB search path

Solution 2888840

Submitted on 29 Aug 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/mss/mlt_rmt_tmw/scoring-engine'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test1 (line 2) assert(isequal(isonpath(str),true))

2   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/testframework/parallel'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test2 (line 2) assert(isequal(isonpath(str),true))

3   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/shared/imageslib'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test3 (line 2) assert(isequal(isonpath(str),true))

4   Fail
str = '/opt/mlsedu/matlab/R2016b/help/toolbox/vision/examples'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test4 (line 2) assert(isequal(isonpath(str),true))

5   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/shared/bigdata'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test5 (line 2) assert(isequal(isonpath(str),true))

6   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/demos'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test6 (line 2) assert(isequal(isonpath(str),true))

7   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/funfun'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test7 (line 2) assert(isequal(isonpath(str),true))

8   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/system'; assert(isequal(isonpath(str),true))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test8 (line 2) assert(isequal(isonpath(str),true))

9   Fail

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test9 (line 2) assert(isequal(isonpath(str),true))

10   Fail
str = ''; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test10 (line 2) assert(isequal(isonpath(str),false))

11   Fail
str = '/opt/'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test11 (line 2) assert(isequal(isonpath(str),false))

12   Fail
str = 'matlab'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test12 (line 2) assert(isequal(isonpath(str),false))

13   Fail
str = '/matlab/R2016b/toolbox'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test13 (line 2) assert(isequal(isonpath(str),false))

14   Fail
str = 'not a directory'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test14 (line 2) assert(isequal(isonpath(str),false))

15   Fail
str = '/opt/mlsedu/matlab/R2016b/toolbox/matlab/timefun/fakedirectory'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test15 (line 2) assert(isequal(isonpath(str),false))

16   Fail
str = 'blah/blah/blah'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test16 (line 2) assert(isequal(isonpath(str),false))

17   Fail
str = 'C:\Program Files\MATLAB\R2016a\toolbox\matlab\datafun'; assert(isequal(isonpath(str),false))

Output argument "tf" (and maybe others) not assigned during call to "isonpath". Error in Test17 (line 2) assert(isequal(isonpath(str),false))

18   Fail
str = []; assert(isequal(isonpath(str),false))