%循环读取和存储dat文件:
for (int i1=1; i1<=20; i1++)
{
for (int j1=1; j1<=4;j1++)
{
char readfile[15];
sprintf_s(readfile, "d%dc%d.dat", i1,j1);
read_data(readfile,WrappedImage,volume_size);
char writefile[15];
sprintf_s(writefile, "und%dc%d.dat", i1,j1);
write_data(writefile,WrappedImage,volume_size);
}
}
%读取dat文件
void read_data(char *inputfile,float *Data, int length)
{
printf("Reading the Wrapped Values form Binary File.............>");
FILE *ifptr;
ifptr = fopen(inputfile,"rb");
if(ifptr == NULL) printf("Error opening the file\n");
fread(Data,sizeof(float),length,ifptr);
fclose(ifptr);
printf(" Done.\n");
}
%保存dat文件
void wri