1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
clear all clc
str = input('请输入数据文件夹名称:'); DataFileName = sprintf('%d',str);
DataFileInf=dir(DataFileName); stop_tag = length({DataFileInf.name});
n=1; while n+2<=stop_tag DataText(n).Name = DataFileInf(n+2).name;
userpath(DataFileInf(1).folder);
fileID = fopen(DataText(n).Name); CellMidDatas = textscan(fileID,'%s %*[^\n]'); fclose(fileID);
mid = CellMidDatas{1};
C_usfull_data = [mid(3,1),mid(8,1),mid(9,1),mid(10,1)];
usfull_data_str = cell2mat(C_usfull_data); C_usfull_data_num = regexp(usfull_data_str,'\d*\.?\d*','match'); usfull_data_num = string(C_usfull_data_num); usfull_data = str2double(usfull_data_num); Data(n,:) = usfull_data(1,:); n=n+1; end disp('统计数据完成'); Data J_sc = Data(:,1); V_oc = Data(:,2); FF = Data(:,3); Eta = Data(:,4);
for n=19:32 box2_3(n-18,1)=J_sc(n,1); end for n=36:53 box2_3(n-35+14,1) = J_sc(n,1); end for n=1:9 sqr(n,1) = J_sc(n,1); end for n=10:18 box1_2(n-9,1) = J_sc(n,1); end for n=33:35 box1_2(n-32+9,1) = J_sc(n,1); end for n=54:62 box1_2(n-53+9+3,1) = J_sc(n,1); end
y1 = repmat("box2_3",length(box2_3),1); y2 = repmat("box1_2",length(box1_2),1); y3 = repmat("sqr",length(sqr),1); X=vertcat(box2_3,box1_2,sqr); Y=vertcat(y1,y2,y3);
figure('Name','Jsc'); boxplot(X,Y); xlabel('condition'); ylabel('Jsc'); title('The boxplot of Jsc');
for n=19:32 box2_3(n-18,1)=V_oc(n,1); end for n=36:53 box2_3(n-35+14,1) = V_oc(n,1); end for n=1:9 sqr(n,1) = V_oc(n,1); end for n=10:18 box1_2(n-9,1) = V_oc(n,1); end for n=33:35 box1_2(n-32+9,1) = V_oc(n,1); end for n=54:62 box1_2(n-53+9+3,1) = V_oc(n,1); end
y1 = repmat("box2_3",length(box2_3),1); y2 = repmat("box1_2",length(box1_2),1); y3 = repmat("sqr",length(sqr),1); X=vertcat(box2_3,box1_2,sqr); Y=vertcat(y1,y2,y3);
figure('Name','Voc'); boxplot(X,Y); xlabel('condition'); ylabel('Voc'); title('The boxplot of Voc');
for n=19:32 box2_3(n-18,1)=FF(n,1); end for n=36:53 box2_3(n-35+14,1) = FF(n,1); end for n=1:9 sqr(n,1) = FF(n,1); end for n=10:18 box1_2(n-9,1) = FF(n,1); end for n=33:35 box1_2(n-32+9,1) = FF(n,1); end for n=54:62 box1_2(n-53+9+3,1) = FF(n,1); end
y1 = repmat("box2_3",length(box2_3),1); y2 = repmat("box1_2",length(box1_2),1); y3 = repmat("sqr",length(sqr),1); X=vertcat(box2_3,box1_2,sqr); Y=vertcat(y1,y2,y3);
figure('Name','FF'); boxplot(X,Y); xlabel('condition'); ylabel('FF'); title('The boxplot of FF');
for n=19:32 box2_3(n-18,1)=Eta(n,1); end for n=36:53 box2_3(n-35+14,1) = Eta(n,1); end for n=1:9 sqr(n,1) = Eta(n,1); end for n=10:18 box1_2(n-9,1) = Eta(n,1); end for n=33:35 box1_2(n-32+9,1) = Eta(n,1); end for n=54:62 box1_2(n-53+9+3,1) = Eta(n,1); end
y1 = repmat("box2_3",length(box2_3),1); y2 = repmat("box1_2",length(box1_2),1); y3 = repmat("sqr",length(sqr),1); X=vertcat(box2_3,box1_2,sqr); Y=vertcat(y1,y2,y3);
figure('Name','Eta'); boxplot(X,Y); xlabel('condition'); ylabel('Eta'); title('The boxplot of Eta');
|