SUNY Geneseo Department of Computer Science
Monday, March 3
CSci 120, Spring 2014
Prof. Doug Baldwin
Edinburgh engineering has reorganized its web site
Question 4 (matrices, copying A to result wherever A > B)?
function C = pick( A, B )
mask = A > B;
C = mask .* A;
end
>> A = [ 4 6 9; 8 2 4]
A =
4 6 9
8 2 4
>> B = [ 3 8 9; 10 1 3]
B =
3 8 9
10 1 3
>> pick(A,B)
ans =
4 0 0
0 2 4