fid=fopen('train-images-idx3-ubyte','r','b') magic_number = fread(fid,1,'int32') number_of_items = fread(fid, 1, 'int32') number_of_rows = fread(fid,1,'int32') number_of_columns = fread(fid,1,'int32') img = fread(fid, [28*28 60000],'uint8'); size(img) img = reshape(img,28,28,60000); size(img) v = uint8(img(:,:,1)'); % imshow(v) v = uint8(img(:,:,2)'); % imshow(v) v = uint8(img(:,:,60000)'); % imshow(v)