3
votes

I have 3 2D matrices of the same size (let say 200 rows and 300 columns). Every matrix represent the value of one of the three "basic" color (red, green and blue). The values of the matrix can be between 0 and 255. Now I want to combine these matrices to show them as a colored image (200 by 300 pixels). How can I do it in MATLAB?

1

1 Answers

10
votes

Catenate the images along the 3rd dimension to create an m-by-n-by-3 RGB image. Assuming your red channel image is called red, you write

figure,
imshow(cat(3,red,green,blue))