Cody

# Problem 44246. Delete the column with all 0 in the TABLE

Solution 2169585

Submitted on 22 Mar 2020
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
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'} m = 1×1 cell array {'Banana'} k = 2 m = 1×2 cell array {'Banana'} {'Orange'} k = 3 m = 1×2 cell array {'Banana'} {'Orange'}

Output argument "newT" (and maybe others) not assigned during call to "myTable". Error in Test1 (line 8) assert(isequal(myTable(T),T_correct))

2   Fail
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'} m = 1×1 cell array {'Hyacinth'} k = 2 m = 1×1 cell array {'Hyacinth'}

Output argument "newT" (and maybe others) not assigned during call to "myTable". Error in Test2 (line 9) assert(isequal(myTable(T),T_correct))