11-2 多維????建?

Ynإߤ@²檺h}CAig MATLAB OJAҦp

Example 1: 11-h}C/mDim01.mA = [1 0 2 5; 4 1 8 7; 3 2 6 3]; A(:, :, 2) = [3 5 4 1; 2 6 2 1; 4 2 3 0] A(:,:,1) = 1 0 2 5 4 1 8 7 3 2 6 3 A(:,:,2) = 3 5 4 1 2 6 2 1 4 2 3 0

bWҤAOإߤ@ӤG}C A AAJĤGG}C A(G,G,2) A̦覡vJG}CeAYiإߤT}CCpG]wY@ӷs@ӤȡAMATLAB |NLw]w 0 AҦpG

Example 2: 11-h}C/mDim02.mA=[1 0 2 5; 4 1 8 7; 3 2 6 3]; A(:, :, 2)=[3 5 4 1; 2 6 2 1; 4 2 3 0]; A(2, 1, 3)=5; disp(A); (:,:,1) = 1 0 2 5 4 1 8 7 3 2 6 3 (:,:,2) = 3 5 4 1 2 6 2 1 4 2 3 0 (:,:,3) = 0 0 0 0 5 0 0 0 0 0 0 0

ڭ̤]iHϥ MATLAB ¶qi}]Scalar Expansion^\A]w@ӯ¶qh}C@AҦpAYnN}C A ĤGҦ] 7AiJpUG

Example 3: 11-h}C/mDim03.mA=[1 0 2 5; 4 1 8 7; 3 2 6 3]; A(:, :, 2)=7; disp(A); (:,:,1) = 1 0 2 5 4 1 8 7 3 2 6 3 (:,:,2) = 7 7 7 7 7 7 7 7 7 7 7 7

h}CAi cat OӫإߡA\ରuñơvƭӰ}CAåiwuñơvɩҥΪסAO榡pUG

Z = cat(dim, A, B, CK)

䤤 ABBBC }CAdim ON ABBBCK X֮ɩҥΨ쪺סCҦpGNx} A P B WU]^ñơAiJG

Example 4: 11-h}C/cat01.mA = [1 2; 3 4]; B = [1 0; 0 1]; Z = cat(1, A, B) % Ʀr 1 ܱN}C A P B WUñ Z = 1 2 3 4 1 0 0 1

YN}C A P B k]^ñơAiJG

Example 5: 11-h}C/cat02.mA = [1 2; 3 4]; B = [1 0; 0 1]; Z = cat(2, A, B) % Ʀr 2 ܱN}C A P B kñ Z = 1 2 1 0 3 4 0 1

YN}C A P B |_ӡAHo@ӤT}CAiJG

Example 6: 11-h}C/cat03.mA = [1 2; 3 4]; B = [1 0; 0 1]; Z = cat(3, A, B) % Ʀr 3 ܱN}C A P B |ƦT} Z(:,:,1) = 1 2 3 4 Z(:,:,2) = 1 0 0 1

Yҳ]w dim Ȥ}C ABBBCKUۭu׼ơv]Dimensionality^٭nWX 2 ΧhAh MATLAB |۰ʸɤWjp 1 סAҦpG

Example 7: 11-h}C/cat04.mA = [1 2; 3 4]; B = [1 0; 0 1]; Z = cat(4, A, B) % Ʀr 4 ܱN}C A P B b۾Fucv Z(:,:,1,1) = 1 2 3 4 Z(:,:,1,2) = 1 0 0 1

ɰ}C Z ܬ 2212C]Ū̥iHQoOch}CAC@cU@AC@O 22 x}C ^

MATLAB iͯSγ~h}CAҦpGYnͤ@Ӻ׬O 235 üư}CAi rand OG

Example 8: 11-h}C/rand01.mA=rand(2,3,4) A(:,:,1) = 0.8147 0.1270 0.6324 0.9058 0.9134 0.0975 A(:,:,2) = 0.2785 0.9575 0.1576 0.5469 0.9649 0.9706 A(:,:,3) = 0.9572 0.8003 0.4218 0.4854 0.1419 0.9157 A(:,:,4) = 0.7922 0.6557 0.8491 0.9595 0.0357 0.9340

OA٦ randnBonesBzeros ΨӲͯSγ~x}AԨѲĤEux}BzPBvĤG`uSγ~x}vC


MATLAB{]pGJg