Depends on what w is, what the sizes of the variables are, and what MATLAB version you are running. If you do the M*w first then the result could be a lot smaller than M, so the subsequent multiply by 0.25 is not as much as doing the 0.25 multiply first. Also, different versions of MATLAB handle the scalar * sparse multiply differently, so you can get significantly different timing answers on different machines with different versions of MATLAB.
James Tursa
The first version does this
v = (0.25*M)*w
The reason why it's slower is now obvious: in one case the scalar is multiplied with a matrix; in other case the scalar is multiplied with a vector.
Bruno