Cody

Solution 569084

Submitted on 29 Jan 2015 by Jan Orwat
  • Size: 12
  • This is the leading solution.
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
A=uint8(magic(8)); g=6; d=[ 0 2 4 6] assert(isequal(unique(image_and(A,g)),d))

d = 0 2 4 6

2   Pass
%% %test 2 A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); A=A(3:20,40:45); g=12; d=[ 0 4 8 12] assert(isequal(unique(image_and(A,g)),d))

d = 0 4 8 12

3   Pass
%% %test 3 A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); g=255; d=A; assert(isequal(image_and(A,g),d))

4   Pass
%% %test 4 A=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg'); A=rgb2gray(A); g=0; d=0*A; assert(isequal(image_and(A,g),d))

Suggested Problems

More from this Author22