MATLAB: Operations depending on the row/column

for loopif statementMATLABmatrix

I have a 339×339 matrix (f2) containing values and I need to multiply all the cells below row 170 and columns less than 170 by -1. Below is what I have so far.
for t=1:339
if t < 170
f2=f2*-1;
end
end
This just makes everything negative.
Thank you for your help!

Best Answer

f2(1:169,:) = -f2(1:169,:)