Cody

Solution 2169587

Submitted on 22 Mar 2020 by Nikolaos Nikolaou
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
Banana = [0;0;0]; Apple = [71;5;64]; Orange = [0;0;0]; Mellon= [2;4;34]; T = table(Banana,Apple,Orange,Mellon); T_correct =table(Apple,Mellon) ; assert(isequal(myTable(T),T_correct))

S = 1×4 cell array {'Banana'} {'Apple'} {'Orange'} {'Mellon'} T = 3x3 table <strong>Apple</strong> <strong>Orange</strong> <strong>Mellon</strong> <strong>_____</strong> <strong>______</strong> <strong>______</strong> 71 0 2 5 0 4 64 0 34 T = 3x2 table <strong>Apple</strong> <strong>Mellon</strong> <strong>_____</strong> <strong>______</strong> 71 2 5 4 64 34 newT = 3x2 table <strong>Apple</strong> <strong>Mellon</strong> <strong>_____</strong> <strong>______</strong> 71 2 5 4 64 34

2   Pass
Tulip = [0;43;38;40;49]; Lily = [71;0;64;67;64]; Amaryllis = [5;163;131;0;70]; Hyacinth= [0; 0 ; 0 ; 0 ; 0 ]; Crocus = [124; 0 ; 4 ; 3 ; 122 ]; T = table(Tulip,Lily,Amaryllis,Hyacinth,Crocus); T_correct =table(Tulip,Lily,Amaryllis,Crocus) ; assert(isequal(myTable(T),T_correct))

S = 1×5 cell array {'Tulip'} {'Lily'} {'Amaryllis'} {'Hyacinth'} {'Crocus'} T = 5x4 table <strong>Tulip</strong> <strong>Lily</strong> <strong>Amaryllis</strong> <strong>Crocus</strong> <strong>_____</strong> <strong>____</strong> <strong>_________</strong> <strong>______</strong> 0 71 5 124 43 0 163 0 38 64 131 4 40 67 0 3 49 64 70 122 newT = 5x4 table <strong>Tulip</strong> <strong>Lily</strong> <strong>Amaryllis</strong> <strong>Crocus</strong> <strong>_____</strong> <strong>____</strong> <strong>_________</strong> <strong>______</strong> 0 71 5 124 43 0 163 0 38 64 131 4 40 67 0 3 49 64 70 122