Beruflich Dokumente
Kultur Dokumente
>> 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 =
>> X\Y
ans =
30/7/19 3:04 PM MATLAB Command Window 2 of 4
>> X./Y
ans =
>> X.*Y
ans =
15 10 24
49 15 4
0 6 25
>> X^5
ans =
>> 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
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 =
>> randn(4,4)
30/7/19 3:04 PM MATLAB Command Window 4 of 4
ans =
>> 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
>>