![]() |
矩阵求平均值问题
本人是个初学者,现在需要读取文件夹下的数据,然后取部分数据求它的平均值,请各位帮我看看哪里出了错,谢谢了,代码如下:
clear all; close all; rep_con = 5; xcondi{1} = { 'dark' '70kV_10mA_40ms_' '70kV_12.5mA_40ms_' '70kV_16mA_40ms_' '70kV_20mA_40ms_' '70kV_25mA_40ms_' '70kV_32mA_40ms_' '70kV_40mA_40ms_' '70kV_50mA_40ms_' '70kV_63mA_40ms_' '70kV_80mA_40ms_' }; dose{1} = [ 0 0 0 0 0 1.263 1.255 1.261 1.245 1.266 1.575 1.563 1.58 1.57 1.578 2.006 1.998 2 2.006 2.008 2.501 2.504 2.509 2.51 2.513 3.139 3.158 3.127 3.142 3.152 4.053 4.024 4.037 4.01 4.045 5.071 5.042 5.063 5.024 5.042 6.322 6.292 4.521 6.344 6.292 5.69 5.678 5.666 5.696 5.687 7.257 7.233 7.226 7.221 7.244 ];for i = 1:1 for j = 1:length(xcondi{i}) for k = 1:rep_con fname = ['d:\','Measurement\','PGA', num2str(i-1), '_VT1.68\',xcondi{i}{j},num2str(k),'.DCM']; fid = fopen(fname,'r'); fprintf('Reading %s ...\r\n', fname); fseek(fid, 1402, 'bof'); a = fread(fid, 3072*3072, 'uint16'); a = reshape(a, 3072, 3072); ave.sig(i,j,k)=mean2(a(110:238,104:232)); fprintf('ave.sig(i,j,k)=%5.3f\n f',ave.sig(i,j,k)) close(fid); end end end Reading d:\Measurement\PGA0_VT1.68\dark1.DCM ... ave.sig(i,j,k)=4926.440 ??? Error using ==> close at 93 Invalid figure handle. |
所有时间均为北京时间。现在的时间是 13:52。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.