Reputation: 1153
How can I form one image containing two squares in matlab from a 3 * 2 matrix containing the RGB values?
eg:
Upvotes: 1
Views: 494
Reputation: 4074
RGB = [255 0; 0 255; 0 0]; % red and green
rectSize = 50;
imshow([repmat(reshape(RGB(:,1),[1 1 3]),[rectSize rectSize]) repmat(reshape(RGB(:,2),[1 1 3]),[rectSize rectSize])]);
Upvotes: 3