MATLAB: Replace values in a matrix with values from another matrix if a condition is met

arraymatrixreplace

Hi,
So I have 3 matrices A, B and C
I want to check the Values in A and B (they are the same size), if the value in A exceeds the Value in B replace it with the value in B (only for that column) then output the result to C (or even just change A)
Essentially:
a = [11 25 55 75 105]
b = [15 30 50 80 100]
c = [11 25 50 75 100]
any solutions?
thanks in advance

Best Answer

a = [11 25 55 75 105]
b = [15 30 50 80 100]
c=min(a,b)