dot product on the rows of A:
z.*A(i,:)
dot product on the columns of A:
z.*A(:,i)
If you want to keep z as a row/column vectorI think you will still need to loop, Although you could make a temporary variable that was padded with lots of z's...
ztemp=zeros(size(A))
ztemp(1:size(A,1),:)...