Sie sind auf Seite 1von 4

30/7/19 3:04 PM MATLAB Command Window 1 of 4

>> X=[3,5,6;7,5,2;0,3,5]

X =

3 5 6
7 5 2
0 3 5

>> Y=[5,2,4;7,3,2;5,2,5]

Y =

5 2 4
7 3 2
5 2 5

>> X+Y

ans =

8 7 10
14 8 4
5 5 10

>> X-Y

ans =

-2 3 2
0 2 0
-5 1 0

>> X*Y

ans =

80 33 52
80 33 48
46 19 31

>> X/Y

ans =

-98.0000 19.0000 72.0000


-50.0000 11.0000 36.0000
-80.0000 15.0000 59.0000

>> X\Y

ans =
30/7/19 3:04 PM MATLAB Command Window 2 of 4

-6.7500 -2.8750 -4.7500


13.7500 5.8750 8.7500
-7.2500 -3.1250 -4.2500

>> X./Y

ans =

0.6000 2.5000 1.5000


1.0000 1.6667 1.0000
0 1.5000 1.0000

>> X.*Y

ans =

15 10 24
49 15 4
0 6 25

>> X^5

ans =

76046 96448 94382


88634 112416 110010
38661 49032 47981

>> Y^0-2

ans =

-1 -2 -2
-2 -1 -2
-2 -2 -1

>> X'

ans =

3 7 0
5 5 3
6 2 5

>> Y'

ans =

5 7 5
2 3 2
30/7/19 3:04 PM MATLAB Command Window 3 of 4

4 2 5

>> //creating matrices


//creating matrices

Error: Unexpected MATLAB operator.

>> /creating matrices


/creating matrices

Error: Unexpected MATLAB operator.

>> %creating matrices


>> zeros(3,4)

ans =

0 0 0 0
0 0 0 0
0 0 0 0

>> ones(7,9)

ans =

1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1

>> eye(2,4)

ans =

1 0 0 0
0 1 0 0

>> rand(4,4)

ans =

0.8147 0.6324 0.9575 0.9572


0.9058 0.0975 0.9649 0.4854
0.1270 0.2785 0.1576 0.8003
0.9134 0.5469 0.9706 0.1419

>> randn(4,4)
30/7/19 3:04 PM MATLAB Command Window 4 of 4

ans =

-0.1241 0.6715 0.4889 0.2939


1.4897 -1.2075 1.0347 -0.7873
1.4090 0.7172 0.7269 0.8884
1.4172 1.6302 -0.3034 -1.1471

>> help(rand)
Input is a value of type double.

>> magic(4)

ans =

16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1

>> pascal(5)

ans =

1 1 1 1 1
1 2 3 4 5
1 3 6 10 15
1 4 10 20 35
1 5 15 35 70

>>

Das könnte Ihnen auch gefallen