I have a question about the purpose of the matrix.
let's say I have three matrices A, B and C, and I want to assign the elements of the matrix C to the elements A and B according to the rule
C[i,j] = A[i,j] if abs(C[i,j] - A[i,j]) < abs(C[i,j] - B[i,j]) C[i,j] = B[i,j] if abs(C[i,j] - A[i,j]) > abs(C[i,j] - B[i,j]) C[i,j] = 0 if abs(C[i,j] - A[i,j]) == abs(C[i,j] - B[i,j])
how can i write it without loops?
Many thanks for your help.
source share