Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
rgb = [1 1 0;
1 0 1;
0 1 1;
1 0 0;
0 1 0;
0 0 1;
1 1 1;
0 0 0];
str = 'ymcrgbwk';
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:)),str(ii)))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
2 | Pass |
%%
rgb = [1 1 0;
1 0 1;
0 1 1;
1 0 0;
0 1 0;
0 0 1;
1 1 1;
0 0 0];
str = 'ymcrgbwk';
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:),'short'),str(ii)))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
3 | Pass |
%%
rgb = [1 1 0;
1 0 1;
0 1 1;
1 0 0;
0 1 0;
0 0 1;
1 1 1;
0 0 0];
str = {'yellow','magenta','cyan','red','green','blue','white','black'};
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:),'long'),str{ii}))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
4 | Pass |
%%
rng('default');
rgb = rand(8,3);
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:)),''))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
5 | Pass |
%%
rng(673);
rgb = round(rand(8,3)*10)/10;
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:),'short'),''))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
6 | Pass |
%%
rgb = round(rand(8,3)*10)/10;
for ii=1:size(rgb,1)
assert(isequal(rgb2str(rgb(ii,:),'long'),''))
end
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
ans =
Columns 1 through 23
'k' '@' 'b' '@' 'g' '@' 'c' '@' 'r' '@' 'm' '@' 'y' '@' 'w' '@' 'black' '@' 'blue' '@' 'green' '@' 'cyan'
Columns 24 through 31
'@' 'red' '@' 'magenta' '@' 'yellow' '@' 'white'
|
984 Solvers
given 3 sides, find area of this triangle
600 Solvers
Arrange Vector in descending order
1801 Solvers
112 Solvers
167 Solvers