Cody

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

Solution 2888849

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))

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

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

Error in solution: Line: 11 Column: 85 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

Suggested Problems

More from this Author44

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!