11-3 多維???????

\hΩVqMx}ƾǹBAҦp sumBmaxBminBmean A]iHΦbh}CAOnSO`NAbϥγoǫOɡAڭ̥woǫOާ@Ob@ӺסAҦpG

Example 1: 11-h}C/sum01.mA = [1 1 1 1; 2 2 2 2; 3 3 3 3]; B = [0 0 0 0; 1 1 1 1; 1 2 3 4]; Z = cat(3, A, B); % Nx} A, B |@ӤT}C S = sum(Z, 1) % ھڲĤ@רӹ露iۥ[ size(S) S(:,:,1) = 6 6 6 6 S(:,:,2) = 2 3 4 5 ans = 1 4 2

bWzdҤAx} Z jpO 342Asum(Z, 1) OھڲĤ@ӺרӶiۥ[A]Ĥ@Ӻ׭ȴN|QO 1A] size(S) ҶǦ^ȬO [1, 4, 2]ANx} S jpO 142C~Asum(Z) w]ۥ[קYO 1A] sum(Z) M sum(Z, 1) ұo쪺GO@˪C

YnĤGӺ׶iۥ[AiUCdҡC

Example 2: 11-h}C/sum02.mA = [1 1 1 1; 2 2 2 2; 3 3 3 3]; B = [0 0 0 0; 1 1 1 1; 1 2 3 4]; Z = cat(3, A, B); % Nx} A, B |@ӤT}C S = sum(Z, 2) % ھڲĤGרӹ露iۥ[ size(S) S(:,:,1) = 4 8 12 S(:,:,2) = 0 4 10 ans = 3 1 2

bWzdҤAsum(Z, 2)OĤGӺ׶iۥ[BA]ҶǦ^x} S ׬O 312C]bѪdҵ{Asum03.m O Z ĤTӺ׶iۥ[BAŪ̦ۤvոլݡC^

bWzdҤAڭ̥iHQ S = sum(Z, 1) O@Φb Z C@AMANG|_ӡA@ӤT}C SCP˪QkA]iHΦb S = sum(Z, 2)C

n`NOApGҭnۥ[ץu@סA sum O|U@Ӻ׶iۥ[ʧ@A]]ŧWzdҡ^sum(sum(Z)) N|oT}C Z C@`MAШUCdҡC

Example 3: 11-h}C/sumSum01.mA = [1 1 1 1; 2 2 2 2; 3 3 3 3]; B = [0 0 0 0; 1 1 1 1; 1 2 3 4]; Z = cat(3, A, B); % Nx} A, B |@ӤT}C S = sum(sum(Z)) S(:,:,1) = 24 S(:,:,2) = 14

PzAYno}C Z Ҧ`MAi sum(sum(sum(Z))) άO sum(Z(:))AbAحzC

P sum O٦ maxBminBmeanBmedianBmodeBstdBdiffBsort AŪ̥iHѦҥѲĤEux}BzPBvĤTp`ux}ƾǹBvC


MATLAB{]pGJg