I = imread('C:\Documents and Settings\Administrator\My Documents\lily.jpg');

R = I(:,:,1);
G = I(:,:,2);
B = I(:,:,3);

A=[R(:) G(:) B(:)]