title: MATLAB synchronized code
body: <p>What is the equivalent to Java's "synchronized" in MATLAB?  </p>
  
  <p>Suppose I have two timers, and they both can modify a variable (i.e. matrix) M. If they fire at the same time, will they both try to change M at once (which could cause errors)? Does MATLAB automatically synchronize such operations?</p>