You are on page 1of 5

MATLAB Command Window Page 1

>> T(:,:,1) = [1 2 3; 4 5 6];


>> T(:,:,2) = [7 8 9; 10 11 12]

T(:,:,1) =

1 2 3
4 5 6

T(:,:,2) =

7 8 9
10 11 12

>> T(:,:,3)=[0 0 0; 0 0 6]

T(:,:,1) =

1 2 3
4 5 6

T(:,:,2) =

7 8 9
10 11 12

T(:,:,3) =

0 0 0
0 0 6

>> A(:,:,1)=[linspace(1,3,3);4 5 6] ;
>> A(:,:,2)=zeros(2,3);
>> A(:,:,3)=ones(2,3);
>> a
Undefined function or variable 'a'.

Did you mean:


>> A

A(:,:,1) =

1 2 3
4 5 6

A(:,:,2) =

0 0 0
MATLAB Command Window Page 2

0 0 0

A(:,:,3) =

1 1 1
1 1 1

>> A=rand(2,3,3)

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=rand(2,3,3);
>> reshape(A,3,3,2)

ans(:,:,1) =

0.7922 0.0357 0.6787


0.9595 0.8491 0.7577
0.6557 0.9340 0.7431

ans(:,:,2) =

0.3922 0.7060 0.0462


0.6555 0.0318 0.0971
0.1712 0.2769 0.8235

>> A = zeros (2,3); B = ones (2,3);


>> cat (1,A,B)

ans =

0 0 0
0 0 0
1 1 1
MATLAB Command Window Page 3

1 1 1

>> cat (2,A,B)

ans =

0 0 0 1 1 1
0 0 0 1 1 1

>> A = zeros (2,3); B = ones (2,3);


>> cat (3,A,B)

ans(:,:,1) =

0 0 0
0 0 0

ans(:,:,2) =

1 1 1
1 1 1

>> A = zeros (2,3); B = ones (2,3);


>> cat (3,A,B)

ans(:,:,1) =

0 0 0
0 0 0

ans(:,:,2) =

1 1 1
1 1 1

>> A=rand(2,3,2)

A(:,:,1) =

0.6948 0.9502 0.4387


0.3171 0.0344 0.3816

A(:,:,2) =

0.7655 0.1869 0.4456


0.7952 0.4898 0.6463

>> A=rand(2,3,2)
MATLAB Command Window Page 4

A(:,:,1) =

0.7094 0.2760 0.6551


0.7547 0.6797 0.1626

A(:,:,2) =

0.1190 0.9597 0.5853


0.4984 0.3404 0.2238

>> sum(A)

ans(:,:,1) =

1.4641 0.9557 0.8177

ans(:,:,2) =

0.6174 1.3001 0.8091

>> A=rand(2,2,2)

A(:,:,1) =

0.7513 0.5060
0.2551 0.6991

A(:,:,2) =

0.8909 0.5472
0.9593 0.1386

>> det(A)
Error using det
Input must be 2-D.

>> det(A(:,:,1)), det(A(:,:,2))

ans =

0.3961

ans =

-0.4014
MATLAB Command Window Page 5

>>

You might also like