SUNY Geneseo Department of Mathematics
Friday, September 12
Math 230 01
Fall 2014
Prof. Doug Baldwin
v1 = [ 7 3 19 -6]
v1 =
7 3 19 -6
v2 = 1:4
v2 =
1 2 3 4
sum( v1 )
ans =
23
v1 + v2
ans =
8 5 22 -2
v1(2)
ans =
3
v1(2) = 103
v1 =
7 103 19 -6
ones( 1, 5 )
ans =
1 1 1 1 1
ones(1,2)
ans =
1 1
ones(1,2) * 2
ans =
2 2
[ones(1,5) 2 2 3 4]
ans =
Columns 1 through 8
1 1 1 1 1 2 2 3
Column 9
4
x = 4
x =
4
y = 17
y =
17
x == y
ans =
0
x == 4
ans =
1
x < y
ans =
1
x <= y
ans =
1
x ~= y
ans =
1
v1
v1 =
7 103 19 -6
v1 == 19
ans =
0 0 1 0
v2
v2 =
1 2 3 4
v2 < v2
ans =
1 1 1 0