Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
A = randi([51 255],[600 800 3]);
t = [0 25 50];
B = warholer(A,t);
assert(all(B(:)==255))
|
2 | Pass |
A = randi(100,[800 600 3]);
t = [100 255 100];
B = warholer(A,t);
assert(all(B(:)==0))
|
3 | Pass |
A = zeros(200,200,3);
t = randi(255,1,3);
B = warholer(A,t);
assert(all(B(:)==0))
|
4 | Pass |
A = 255*ones(100,100,3);
t = randi(254,1,3);
B = warholer(A,t);
assert(all(B(:)==255))
|
5 | Pass |
A(:,:,1) = randi([0 120],[480 320]);
A(:,:,2) = randi([80 200],[480 320]);
A(:,:,3) = randi([160 240],[480 320]);
t = [150 50 150];
B = warholer(A,t);
assert(all(all(B(:,:,1)==0)))
assert(all(all(B(:,:,2)==255)))
assert(all(all(B(:,:,3)==255)))
|
6 | Pass |
A(:,:,1) = randi([0 100],[480 320]);
A(:,:,2) = randi([80 180],[480 320]);
A(:,:,3) = randi([100 240],[480 320]);
t = [180 60 250];
B = warholer(A,t);
assert(all(all(B(:,:,1)==0)))
assert(all(all(B(:,:,2)==255)))
assert(all(all(B(:,:,3)==0)))
|
7 | Pass |
A(:,:,1) = magic(5)*10;
A(:,:,2) = spiral(5)*10;
A(:,:,3) = toeplitz(1:5)*50;
t = [159 99 149];
B_correct(:,:,1) = [255 255 0 0 0;
255 0 0 0 255;
0 0 0 255 255;
0 0 255 255 0;
0 255 255 0 0];
B_correct(:,:,2) = [255 255 255 255 255;
255 0 0 0 255;
255 0 0 0 255;
255 0 0 0 255;
255 255 255 255 255];
B_correct(:,:,3) = [0 0 255 255 255;
0 0 0 255 255;
255 0 0 0 255;
255 255 0 0 0;
255 255 255 0 0];
assert(isequal(warholer(A,t),B_correct))
|
516 Solvers
Find the largest value in the 3D matrix
1056 Solvers
Fahrenheit to Celsius converter
358 Solvers
Number of digits in an integer
336 Solvers
445 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!