function C=maxJ_M(A,B);

%
% Produto max-J_M
%

[m,n]=size(A);

if size(B,1)~=n
	disp('Inner matrix dimensions must agree.');
	return
end

C=zeros(m,size(B,2));
for i=1:m
	for j=1:n
		aux=(B(j,:)<A(i,j));
		C(i,:)=max(C(i,:),aux*A(i,j));
	end
end