1. ones(256)
2. [0:1:255]
3. [0:1:255]'
4. ones(256,1)*[0:1:255]
5. [0:1:255]'*ones(1,256)
6. zeros(256)
7. ones(256)
8. 128*ones(256)
9. zeros(256)
10. imshow(ones(256,1)*[0:1:255]/255)
11. Display the RB face of the colour cube
x(:,:,1)= [ones(256,1)*[0:1:255]/255]';
x(:,:,2)= zeros(256);
x(:,:,3)= [ones(256,1)*[0:1:255]/255];
imshow(x)
12. Display the RG face of the colour cube:
x(:,:,1)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,2)=[ones(256,1)*[0:1:255]/255];
x(:,:,3)=zeros(256);
imshow(x)
13. Display the GB face of the colour cube:
x(:,:,1)=zeros(256);
x(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,3)=[ones(256,1)*[0:1:255]/255];
imshow(x)
14, 15, 16. Display the CM, MY, and YC (according to Mike's answer from the facebook) faces of the colour cube:
CM face
x(:,:,1)=[ones(256,1)*[0:1:255]/255];
x(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,3)=ones(256);
imshow(x)
MY
x(:,:,1)=ones(256);
x(:,:,2)=[ones(256,1)*[0:1:255]/255];
x(:,:,3)=[ones(256,1)*[0:1:255]/255]’;
imshow(x)
YC
x(:,:,1)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,2)=ones(256);
x(:,:,3)=[ones(256,1)*[0:1:255]/255];
imshow(x)
19. A=[1 2 3;4 5 6;7 8 ];
B=[0 0 1;1 0 0;0 1 0]
x=A*B
x=
2 3 1
5 6 4
8 9 7
20.
A=[1 2 3;4 5 6;7 8 9];
B=[0 0 1;1 0 0;0 1 0];
x=B*A
x=
7 8 9
1 2 3
4 5 6
22.
A=[1 2 3;4 5 6;7 8 9];
B=[0 0 0;1 0 0;0 1 0];
x=B*A
x=
0 0 0
1 2 3
4 5 6
21.
#23
W(:,:,1)=ones(256);
W(:,:,2)=ones(256);
W(:,:,3)=ones(256);
CM(:,:,1)=[ones(256,1)*[0:1:255]/255];
CM(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
CM(:,:,3)=ones(256);
CM=rotdim(CM,-1);
BR(:,:,1)= [ones(256,1)*[0:1:255]/255];
BR(:,:,2)= zeros(256);
BR(:,:,3)= [ones(256,1)*[0:1:255]/255]’;
BG(:,:,1)= zeros(256);
BG(:,:,2)= [ones(256,1)*[0:1:255]/255]’;
BG(:,:,3)= [ones(256,1)*[0:1:255]/255];
BG=rotdim(BG,-1);
YC(:,:,1)= [ones(256,1)*[0:1:255]/255]’;
YC(:,:,2)=ones(256);
YC(:,:,3)= [ones(256,1)*[0:1:255]/255];
YC=rotdim(YC,-1);
RG(:,:,1)= [ones(256,1)*[0:1:255]/255]’;
RG(:,:,2)= [ones(256,1)*[0:1:255]/255];
RG(:,:,3)= zeros(256);
RG=rotdim(RG,2);
MY(:,:,1)= ones(256);
MY(:,:,2)= [ones(256,1)*[0:1:255]/255];
MY(:,:,3)= [ones(256,1)*[0:1:255]/255]’;
imshow([W,W,RG,W;MY,YC,BG,BR;W,W,CM,W])
2. [0:1:255]
3. [0:1:255]'
4. ones(256,1)*[0:1:255]
5. [0:1:255]'*ones(1,256)
6. zeros(256)
7. ones(256)
8. 128*ones(256)
9. zeros(256)
10. imshow(ones(256,1)*[0:1:255]/255)
11. Display the RB face of the colour cube
x(:,:,1)= [ones(256,1)*[0:1:255]/255]';
x(:,:,2)= zeros(256);
x(:,:,3)= [ones(256,1)*[0:1:255]/255];
imshow(x)
12. Display the RG face of the colour cube:
x(:,:,1)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,2)=[ones(256,1)*[0:1:255]/255];
x(:,:,3)=zeros(256);
imshow(x)
13. Display the GB face of the colour cube:
x(:,:,1)=zeros(256);
x(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,3)=[ones(256,1)*[0:1:255]/255];
imshow(x)
14, 15, 16. Display the CM, MY, and YC (according to Mike's answer from the facebook) faces of the colour cube:
CM face
x(:,:,1)=[ones(256,1)*[0:1:255]/255];
x(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,3)=ones(256);
imshow(x)
MY
x(:,:,1)=ones(256);
x(:,:,2)=[ones(256,1)*[0:1:255]/255];
x(:,:,3)=[ones(256,1)*[0:1:255]/255]’;
imshow(x)
YC
x(:,:,1)=[ones(256,1)*[0:1:255]/255]’;
x(:,:,2)=ones(256);
x(:,:,3)=[ones(256,1)*[0:1:255]/255];
imshow(x)
19. A=[1 2 3;4 5 6;7 8 ];
B=[0 0 1;1 0 0;0 1 0]
x=A*B
x=
2 3 1
5 6 4
8 9 7
20.
A=[1 2 3;4 5 6;7 8 9];
B=[0 0 1;1 0 0;0 1 0];
x=B*A
x=
7 8 9
1 2 3
4 5 6
22.
A=[1 2 3;4 5 6;7 8 9];
B=[0 0 0;1 0 0;0 1 0];
x=B*A
x=
0 0 0
1 2 3
4 5 6
21.
#23
W(:,:,1)=ones(256);
W(:,:,2)=ones(256);
W(:,:,3)=ones(256);
CM(:,:,1)=[ones(256,1)*[0:1:255]/255];
CM(:,:,2)=[ones(256,1)*[0:1:255]/255]’;
CM(:,:,3)=ones(256);
CM=rotdim(CM,-1);
BR(:,:,1)= [ones(256,1)*[0:1:255]/255];
BR(:,:,2)= zeros(256);
BR(:,:,3)= [ones(256,1)*[0:1:255]/255]’;
BG(:,:,1)= zeros(256);
BG(:,:,2)= [ones(256,1)*[0:1:255]/255]’;
BG(:,:,3)= [ones(256,1)*[0:1:255]/255];
BG=rotdim(BG,-1);
YC(:,:,1)= [ones(256,1)*[0:1:255]/255]’;
YC(:,:,2)=ones(256);
YC(:,:,3)= [ones(256,1)*[0:1:255]/255];
YC=rotdim(YC,-1);
RG(:,:,1)= [ones(256,1)*[0:1:255]/255]’;
RG(:,:,2)= [ones(256,1)*[0:1:255]/255];
RG(:,:,3)= zeros(256);
RG=rotdim(RG,2);
MY(:,:,1)= ones(256);
MY(:,:,2)= [ones(256,1)*[0:1:255]/255];
MY(:,:,3)= [ones(256,1)*[0:1:255]/255]’;
imshow([W,W,RG,W;MY,YC,BG,BR;W,W,CM,W])
24.imshow([MY,YC,BG,BR])
No comments:
Post a Comment