fid=fopen('fx.txt','r'); %把文件的数据读到f中,f为12*90的矩阵 [f,count]=fscanf(fid,'%f %f',[12,90]); %关闭文件 fclose(fid);