I have found a clever way to do it. Convert the small matrix into N dimensional array and multiply.
A=gpuArray(rand(20,20,16,10));
B=gpuArray(rand(16,10));
C=Matrisize(B,A);
Z=A.*C;
function [C]=Matrisize(X1,X2)
S=size(X2);
C=zeros(size(X2),'like',X2);
for i=1:S(1)
for j=1:S(2)
C(i,j,:,:)=X1;
end
end
end