You should try with loops, conditionals and reshape your matrix .
A = [1 2;3 4];
[r,c] = size[A];
A = reshape(A, [1 r*c]) %with B the same
With A and B (1,r*c) in a loops you can compare with a if
if(A(n) < B(m))
...
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!