MATLAB: What is the meaning of 28x28x3 in .mat file

.mat file

Hi, I save a colour image in .mat file format and realise that the variable is in array 28x28x3. 28×28 is image dimension, but I have no idea on what the "3" meant. I guess it is related to colour. Can anyone explain on this ?
here is the code that I type
  • pic1 = imread('image_0001.jpg');
  • save('BothPics.mat', 'pic1');

Best Answer

  • That means that there are three slices/color channels/pages/planes/(whatever you want to call them) in your 3D array (stack of 2D images).
    Try this:
    [rows, columns, numberOfColorChannels] = size(pic1)