files = dir('*.log'); for i=1:length(files) File =files(i).name; a=importdata(File); b=reshape(a,6,12)';%calculate tramsportation to make std calculation easy kth(:,:,i)=b; end for i=1:24 mymean=mean(kth(:,:,i)); mystd=std(kth(:,:,i)); mymedian=median(kth(:,:,i)); % myresult(:,:,1)=cat(2,myresult(:,:,1),mymean) % myresult(:,:,2)=cat(2,myresult(:,:,2),mystd) % a=cat(2,a,mymean); % b=cat(2,b,mystd); y(i,:)=mymean; e(i,:)=mystd; m(i,:)=mymedian; end y e m fid=fopen('v1mean.txt','wt'); fprintf(fid,'%g\n',y); fclose(fid); fid1=fopen('v1mid.txt','wt'); fprintf(fid1,'%g\n',m); fclose(fid1); x=[1:1:24]; for i=1:6 subplot(2,3,i) % figure('hello') % text('Message transformation of Node v1') % scatter(x,m(:,i),10,'Red'); plot(x,m(:,i),'RED') hold on errorbar(x,y(:,i),e(:,i)); % errorbar(x,y(:,i),1) %title('type"i"') xlabel('time'); ylabel('message'); switch i case 1 title('type1') case 2 title('type2') case 3 title('type3') case 4 title('type4') case 5 title('type5') case 6 title('type6') end end
matlab画出日收盘价20日均值图形,Matlab矩阵处理小结(2)-读数据求均值和中位数 绘制errorbar图...
最新推荐文章于 2024-08-05 19:15:00 发布