Cody

# Problem 2413. Temperature Conversion Utility

Solution 1387677

Submitted on 20 Dec 2017
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
T = 100; u1 = 'C'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-212) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test1 (line 5) assert(abs(T_convertor(T,u1,u2)-212) < eps)

2   Fail
T = 100; u1 = 'C'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-671.67) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test2 (line 5) assert(abs(T_convertor(T,u1,u2)-671.67) < eps)

3   Fail
T = 100; u1 = 'C'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test3 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

4   Fail
T = 100; u1 = 'C'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-373.15) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test4 (line 5) assert(abs(T_convertor(T,u1,u2)-373.15) < eps)

5   Fail
T = 100; u1 = 'K'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-279.67)) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test5 (line 5) assert(abs(T_convertor(T,u1,u2)-(-279.67)) < eps)

6   Fail
T = 100; u1 = 'K'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-180) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test6 (line 5) assert(abs(T_convertor(T,u1,u2)-180) < eps)

7   Fail
T = 100; u1 = 'K'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-173.15)) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test7 (line 5) assert(abs(T_convertor(T,u1,u2)-(-173.15)) < eps)

8   Fail
T = 100; u1 = 'K'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test8 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

9   Fail
T = 100; u1 = 'F'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test9 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

10   Fail
T = 100; u1 = 'F'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-559.67) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test10 (line 5) assert(abs(T_convertor(T,u1,u2)-559.67) < eps)

11   Fail
T = 100; u1 = 'F'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-37.7777778) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test11 (line 5) assert(abs(T_convertor(T,u1,u2)-37.7777778) < eps)

12   Fail
T = 100; u1 = 'F'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-310.9277778) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test12 (line 5) assert(abs(T_convertor(T,u1,u2)-310.9277778) < eps)

13   Fail
T = 100; u1 = 'R'; u2 = 'F'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-359.67)) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test13 (line 5) assert(abs(T_convertor(T,u1,u2)-(-359.67)) < eps)

14   Fail
T = 100; u1 = 'R'; u2 = 'R'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-100) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test14 (line 5) assert(abs(T_convertor(T,u1,u2)-100) < eps)

15   Fail
T = 100; u1 = 'R'; u2 = 'C'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-(-217.5944444)) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test15 (line 5) assert(abs(T_convertor(T,u1,u2)-(-217.5944444)) < eps)

16   Fail
T = 100; u1 = 'R'; u2 = 'K'; eps = 1e-4; assert(abs(T_convertor(T,u1,u2)-55.5555556) < eps)

Undefined function 'eq' for input arguments of type 'cell'. Error in T_convertor (line 25) r = find({'C', 'K', 'F', 'R'}==u1) Error in Test16 (line 5) assert(abs(T_convertor(T,u1,u2)-55.5555556) < eps)