2011-10-18 43 views
0

tesconf是3x3矩陣;matlab對角碼

tes_avg = (diag(tesconf)./sum(tesconf,2)); 

例子tes_avg的結果給出[0.345; 0.3423; 0.483]

但是,我希望得到這3個值的平均結果,我應該如何改變上面的代碼,請指教? ...

回答

2

只需avg = mean(tes_avg);(或直接tes_avg = mean(diag(tesconf)./sum(tesconf,2));)。