DSPRelated.com
Code

RGB (JPEG) Image Separator

Ron April 1, 2011 Coded in Matlab

Script that seperates an RGB image into 3 respective 2D matricies.

clf;
x = imread('input.jpg');
red = x(:,:,1);
green = x(:,:,2);
blue = x(:,:,3);

subplot(2,2,1);
imshow(x);
title('Original');
subplot(2,2,2);
imshow(red);
title('Red');
subplot(2,2,3);
imshow(green);
title('Green');
subplot(2,2,4);
imshow(blue);
title('Blue');