You can use the "imread" function. It transform your image in a n-pixels/m-pixels/3, which is like a 3 layer surface and each layer contains respectively the R, G, and B values of each pixel. For all the details, go to the Mathworks references
it would be easier if you convert the colour image to grayscale or binary. you will obtain 1 layer of matrix instead of 3 layer (RGB) of colour image could be complex.