function TTest fidimg=fopen('t10k-images.idx3-ubyte','rb'); fidla=fopen('t10k-labels.idx1-ubyte','rb'); [img,count]=fread(fidimg,16); [label,count]=fread(fidla,8); Test=cell(10000,2); for i=1:1:10000 [img,count]=fread(fidimg,[28,28]); [label,count]=fread(fidla,1); Test{i,1}=img; Test{i,2}=label; end save Test.mat Test end