Data of an RGB image is a triplet of matrices

A MATLAB file rgb_matrix.m shows a a triplet of matrices of grayscale images of red, green and blu, and an RGB image of its composition.