Cody

# Problem 506. Back to basics 25 - Valid variable names

Solution 1815003

Submitted on 14 May 2019
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
x = 'foo'; y_correct = true; assert(isequal(valid_vars(x),y_correct))

Undefined function 'eq' for input arguments of type 'cell'. Error in valid_vars (line 2) if find(iskeyword == x) > 0 Error in Test1 (line 3) assert(isequal(valid_vars(x),y_correct))

2   Fail
x = 'while'; y_correct = false; assert(isequal(valid_vars(x),y_correct))

Undefined function 'eq' for input arguments of type 'cell'. Error in valid_vars (line 2) if find(iskeyword == x) > 0 Error in Test2 (line 3) assert(isequal(valid_vars(x),y_correct))

3   Fail
x = '1foo'; y_correct = false; assert(isequal(valid_vars(x),y_correct))

Undefined function 'eq' for input arguments of type 'cell'. Error in valid_vars (line 2) if find(iskeyword == x) > 0 Error in Test3 (line 3) assert(isequal(valid_vars(x),y_correct))