function norbload() fid=fopen('smallnorb-5x46789x9x18x6x2x96x96-training-dat.mat','r'); fread(fid,4,'uchar'); % result = [85 76 61 30], byte matrix(in base 16: [55 4C 3D 1E]) fread(fid,4,'uchar'); % result = [4 0 0 0], ndim = 4 numImages = fread(fid,4,'uchar'); % result = [236 94 0 0], dim0 = 24300 (=94*256+236) fread(fid,4,'uchar'); % result = [2 0 0 0], dim1 = 2 fread(fid,4,'uchar'); % result = [96 0 0 0], dim2 = 96 fread(fid,4,'uchar'); % result = [96 0 0 0], dim3 = 96 numImages = numImages for n=1:200, im = transpose(reshape(fread(fid,96*96),96,96))/256; if (mod(n, 2) == 0) size(im) imshow(im); % show the first image pause (0.1); end end;