Cody

# Problem 2527. Cull vector elements that contain a specified digit

Solution 505648

Submitted on 26 Sep 2014 by James
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
%% v = [1 2 5 13 55 23 15]; d = 5; y_correct = [1 2 13 23]; assert(isequal(digitRemove(v,d),y_correct))

n = 1 j = 0 0 0 0 0 0 0 n = 2 j = 0 0 0 0 0 0 0 n = 5 j = 0 0 1 0 0 0 0 n = 1 3 j = 0 0 1 0 0 0 0 n = 5 5 j = 0 0 1 0 1 0 0 n = 2 3 j = 0 0 1 0 1 0 0 n = 1 5 j = 0 0 1 0 1 0 1 ans = 1 2 13 23

2   Pass
%% v = [3 24 7 9 18 55 67 71]; d = 7; y_correct = [3 24 9 18 55]; assert(isequal(digitRemove(v,d),y_correct))

n = 3 j = 0 0 0 0 0 0 0 0 n = 2 4 j = 0 0 0 0 0 0 0 0 n = 7 j = 0 0 1 0 0 0 0 0 n = 9 j = 0 0 1 0 0 0 0 0 n = 1 8 j = 0 0 1 0 0 0 0 0 n = 5 5 j = 0 0 1 0 0 0 0 0 n = 6 7 j = 0 0 1 0 0 0 1 0 n = 7 1 j = 0 0 1 0 0 0 1 1 ans = 3 24 9 18 55

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!