用matlab求excel表中平均值,matlab如何将符合特定条件的数据导入excel并求出平均值...
matlab如何将符合特定条件的数据导入excel并求出平均值 % outline %step_1 clear %step_2 CurrentWorkingPaht %step_3 a Matrix_r %step_4 Loop getting the 20 close and far values %step_5 writing the Matrix_r into the Excel % cle
matlab如何将符合特定条件的数据导入excel并求出平均值
% outline %step_1 clear %step_2 CurrentWorkingPaht %step_3 a Matrix_r %step_4 Loop getting the 20 close and far values %step_5 writing the Matrix_r into the Excel % clear clc;clear; % currentworkingpath CurrentWorkingPath = fileparts(mfilename( fullpath )); Filename_result = [ result_selectionA_1.txt ]; % set a Matrix_r Matrix_r = zeros(20,2); for i = 1:20 tmpPathname = sprintf( %s\\sub%d\\%s ,CurrentWorkingPath,i,Filename_result); [Col_1 Col_2 Col_3 Col_4 Col_5 Array_type Array_RTs Array_ACC] = textread(tmpPathname, %d%d%d%d%d%d%d%d , delimiter , ); doubleC_Mat = [Array_type Array_RTs]; Matrix_r(i,1) = mean(doubleC_Mat(doubleC_Mat(:,1)12,2)); end % writing into the excel file success = xlswrite( student_update.xls , Matrix_r, sheet1 , B2 ); Series = 1:20; Series = Series ;Conditionnames = {[ student_ID ] [ Close ] [ Far ]}; success = xlswrite( student_update.xls , Series, sheet1 , A2 ); success = xlswrite( student_update.xls , Conditionnames, sheet1 , A1 );
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)