Formatted code above --dpb
Your short-circuit operators would have to be "&" instead, but you've introduced length issues that will pop up when you make just that change.
kk is a vector so the variables addressed with it are vectors and you're trying to store a vector into a single array location on the LHS
It's certainly not at all clear what the point of this is, but at a minimum you'd have to have something like
kk=1:N;
Smat1(kk,j)=Smat1(kk,j)+Sloctemp(kk,1,1).*(Sloc(kk,1,5)==countrow && Sloc(kk,5,1)==countcol).*(mod(j,2)==1 && mod(i,2)==1);
but then there's a length mismatch in the last term with the mod() expressions as they're still one element in length.
Believe it would be better to outline the overall problem trying to be solved and let somebody see the big picture instead of trying peephole optimization...