自動化讀入批量數據,進行實驗

int main()
{
	

	int i;
	double a;
	for(i = 1;i <62; ++i)
	{
		char inputname[10];
		char outputname[20];
		double a = 0;
		FILE* record;
		char datafile[20];

		sprintf(inputname,"%d.txt",i);
		sprintf(outputname, "out-2048-LZAP-%d.txt",i);
		
		compress(inputname, outputname);
		
		record = fopen("record-1-61.txt","a");
		
		a = entropy_0_order(outputname);
		
		if(record){
			fprintf(record,"%f ",a);
		}
		fclose(record);
	}
	
	
	return 0;
}
用61個txt進行compress實驗,然後計算產生的61個結果txt的信息熵,記錄在record-1-61.txt中

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章