Cody

Solution 1764371

Submitted on 27 Mar 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,y] = swap_vars(5,10); assert(isequal(x,10)); assert(isequal(y,5));

Undefined function 'swap' for input arguments of type 'double'. Error in swap_vars (line 2) [x,y] = swap(x,y); Error in Test1 (line 1) [x,y] = swap_vars(5,10);

2   Fail
[x,y] = swap_vars('hello','bye'); assert(isequal(x,'bye')); assert(isequal(y,'hello'));

Undefined function 'swap' for input arguments of type 'char'. Error in swap_vars (line 2) [x,y] = swap(x,y); Error in Test2 (line 1) [x,y] = swap_vars('hello','bye');

3   Fail
[x,y] = swap_vars(5,'hello'); assert(isequal(x,'hello')); assert(isequal(y,5));

Undefined function 'swap' for input arguments of type 'double'. Error in swap_vars (line 2) [x,y] = swap(x,y); Error in Test3 (line 1) [x,y] = swap_vars(5,'hello');