SUNY Geneseo Department of Mathematics
Wednesday, February 18
Math 230 02
Spring 2015
Prof. Doug Baldwin
>> A = [ 1 2; 3 4]
A =
1 2
3 4
>> B = [1 2 3;10 20 30]
B =
1 2 3
10 20 30
>> A*B
ans =
21 42 63
43 86 129
>> B*A
Error using *
Inner matrix dimensions must agree.
>> A* [ 10 20; 30 40 ]
ans =
70 100
150 220
>> [ 1 0; 0 1] * A
ans =
1 2
3 4
>> eye(10)
ans =
1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 1
>> A = [ 2 1; 1 -2 ]
A =
2 1
1 -2
>> B = [5 -1]
B =
5 -1
>> A \ B
Error using \
Matrix dimensions must agree.
>> B = B'
B =
5
-1
>> A \ B
ans =
1.8000
1.4000