trying to decipher the mathematical meaning of an if statement in matlab : I have this piece of code that I'm trying understand what is going on. I usually use R, but had to look at a piece of code from matlab.

So can anyone tell me what this if statement does in math??

prob = exp(-dE / kT);

if dE <= 0 I I rand() <= prob;

spin(row, col) = - spin(row, col);

Cheers, Emil