SUNY Geneseo Department of Mathematics
Friday, May 1
Math 230 02
Spring 2015
Prof. Doug Baldwin
Isaac Newton, Calculus, 1667
Newton, Calc, 1667
Leibniz, Calc, 16??
select( value, column, relation )
Go down every row of relation and check for value in column
When you get to row with that value in that column, put it in new relation
(Output is new relation)
function result = select( value, column, relation )
n = number of rows in relation
result = empty cell array
count = 1
for i = 1 to n
if relation{i,column} == value
result(count,:) = relation(i,:)
count = count + 1
isequal
to do this>> isequal( 2, 2 )
ans =
1
>> isequal( 'foo', 'hello' )
ans =
0
>> isequal( 'foo', 'foo' )
ans =
1
>> isequal( 1, 'hello' )
ans =
0