Cody

# Problem 44247. Delete the column with all 0 !

Solution 2169595

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
x=[1 0 0 4;5 0 7 0; 9 0 11 0] y_correct = [1 0 4;5 7 0; 9 11 0] assert(isequal(DelCols(x),y_correct))

x = 1 0 0 4 5 0 7 0 9 0 11 0 y_correct = 1 0 4 5 7 0 9 11 0 t = 1 5 9 y = 1 5 9 t = 0 0 0 t = 0 7 11 y = 1 0 5 7 9 11 t = 4 0 0 y = 1 0 4 5 7 0 9 11 0

2   Pass
x=[1:5;2:6;3:7] y_correct = [1:5;2:6;3:7] assert(isequal(DelCols(x),y_correct))

x = 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 y_correct = 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 t = 1 2 3 y = 1 2 3 t = 2 3 4 y = 1 2 2 3 3 4 t = 3 4 5 y = 1 2 3 2 3 4 3 4 5 t = 4 5 6 y = 1 2 3 4 2 3 4 5 3 4 5 6 t = 5 6 7 y = 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7

3   Pass
x=zeros(10) x(:,3)=7 y_correct =repmat(7,1,10)' assert(isequal(DelCols(x),y_correct))

x = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x = 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 y_correct = 7 7 7 7 7 7 7 7 7 7 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 7 7 7 7 7 7 7 7 7 7 y = 7 7 7 7 7 7 7 7 7 7 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0 t = 0 0 0 0 0 0 0 0 0 0