I have two matrices A(10,5) and B(30,5). By comparison the final output required is logical array of size (10,30) or (30,10). My code:
A=rand(10,5)
B=rand(30,5)
for i=1:size(A,1)
X(:,i)=all(bsxfun(@le,A(i,:),B))
end
In my code, I am not getting the desired result, in terms of size of output matrix.
Is this what you want?
Using the above code,
X(m,n)will betrueiff each entry inA(m,:)is less than or equal to the corresponding entry inB(n,:).