Cody

Problem 43963. Finding operators in a MATLAB function in a string.

Solution 1088158

Submitted on 23 Dec 2016 by Binbin Qi
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   Pass
x = 'min(var1+var2,2)'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

2   Pass
x = 'min(1,2)+min(3,4)'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

3   Pass
x = 'min(min(1,2),3))'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

4   Pass
x = 'min(min(1,var1+2),3))'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

5   Pass
x = '4*var1'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

6   Pass
x = '4*(var1+2)'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

7   Pass
x = 'max(min(1,var1-2),3))'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

8   Pass
x = '4+abs(2)'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

9   Pass
x = '4+abs(2/var1)'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

10   Pass
x = '4+abs(2+min(1+5,1))'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

11   Pass
x = '4+max(2,min(1+5,1))'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

12   Pass
x = '4+max((2,min(1+5,1)))'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

13   Pass
x = 'min(2-1,1)+abs(-5)'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))

14   Pass
x = 'min(var1,1)+abs(-5)'; y_correct = false; assert(isequal(FindingOperators(x),y_correct))

15   Pass
x = 'min(min(var1,var2),1+3)'; y_correct = true; assert(isequal(FindingOperators(x),y_correct))