%将数据保存为串行格式
Dat = [];
for i = 1:R
Dat = [Dat I1(i,:)];
end
fid = fopen('Image_test.coe','wt');
fprintf(fid,'memory_initialization_radix = 10;');
fprintf(fid,'\n');
fprintf(fid,'memory_initialization_vector = ');
fprintf(fid,'\n');
for i = 1:length(Dat)
if i < length(Dat)
fprintf(fid,'%d',Dat(i));
fprintf(fid,',\n');
else
fprintf(fid,'%d',Dat(i));
fprintf(fid,';\n');
end
end