0
Im做的乘法數據集的一些統計分析,但它似乎很愚蠢硬編碼的一切,所以我想知道如果有可能使一個循環的數據集,代碼我已經是這樣的:循環的數據集MATLAB
dsA = dataset('XLSFile','RING 29 deg.xlsx','Sheet',7);
dsB = dataset('XLSFile','RING 29 deg.xlsx','Sheet',8);
dsC = dataset('XLSFile','RING 29 deg.xlsx','Sheet',9);
dsD = dataset('XLSFile','RING 29 deg.xlsx','Sheet',10);
dsE = dataset('XLSFile','RING 29 deg.xlsx','Sheet',11);
dsX = dataset('XLSFile','RING 29 deg.xlsx','Sheet',12);
dsY = dataset('XLSFile','RING 29 deg.xlsx','Sheet',13);
%Testing differences in median after 0,5 sex for A
[p,t,stats_A_1] = kruskalwallis(dsA.x0_5Sec,dsA.Code_1);
title('Differences in median after 0,5 sec for Concentration A')
print(gcf, '-dpdf', 'A_0,5_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_1);
title('Differences in median after 0,5 sec for Concentration A')
[nms num2cell(m)]
%Testing differences in median after 1 sex for A
[p,t,stats_A_2] = kruskalwallis(dsA.x1Sec,dsA.Code_1);
title('Differences in median after 1 sec for Concentration A')
print(gcf, '-dpdf', '73_1_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_2);
title('Differences in median after 1 sec for Concentration A')
[nms num2cell(m)]
%Testing differences in median after 1,5 sex for A
[p,t,stats_A_3] = kruskalwallis(dsA.x1_5Sec,dsA.Code_1);
title('Differences in median after 1,5 sec for Concentration A')
print(gcf, '-dpdf', '73_1,5_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_3);
title('Differences in median after 1,5 sec for Concentration A')
[nms num2cell(m)]
%Testing differences in median after 2 sex for A
[p,t,stats_A_4] = kruskalwallis(dsA.x2Sec,dsA.Code_1);
title('Differences in median after 2 sec for Concentration A')
print(gcf, '-dpdf', 'A_2_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_4);
title('Differences in median after 2 sec for Concentration A')
[nms num2cell(m)]
%Testing differences in median after 2,5 sex for A
[p,t,stats_A_5] = kruskalwallis(dsA.x2_5Sec,dsA.Code_1);
title('Differences in median after 2,5 sec for Concentration A')
print(gcf, '-dpdf', 'A_2,5_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_5);
title('Differences in median after 2,5 sec for Concentration A')
[nms num2cell(m)]
%Testing differences in median after 3 sex for A
[p,t,stats_A_6] = kruskalwallis(dA.x3Sec,dA.Code_1);
title('Differences in median after 3 sec for Concentration A')
print(gcf, '-dpdf', 'A_3_sec.pdf');
figure;
[c,m,h,nms] = multcompare(stats_A_6);
title('Differences in median after 3 sec for Concentration A')
我需要做到這一點,數據集A到Y,硬編碼,只是似乎愚蠢...但我已經嘗試做一個循環,就像我在做圖像處理但我不能讓它工作,當我嘗試與數據集,有沒有人有如何做到這一點的想法? 祝您有美好的一天
我同意結構更簡單,如ds(1).data加ds(1).stats,並對每個數據集進行迭代。 –
@ R.Bergamote:你說得對,統計數據中'struct'是更好的選擇。我沒有閱讀「kruskalwallis」的文檔,只是選擇了一個存儲任何內容的「單元」。 – Daniel