Incorrect matrix_world after transformation This script changes the active object's location, it could also change the rotation or scale, it also prints the object's world matrix before and after changing the location.

import bpy
obj = bpy.context.object
print(obj.matrix_world)
obj.location = 1, 2, 3
print(obj.matrix_world)


The output shows the same matrix as before and after the translation:

&lt;Matrix 4x4 (1.0000, 0.0000, 0.0000, 0.0000)
            (0.0000, 1.0000, 0.0000, 0.0000)
            (0.0000, 0.0000, 1.0000, 0.0000)
            (0.0000, 0.0000, 0.0000, 1.0000)&gt;
&lt;Matrix 4x4 (1.0000, 0.0000, 0.0000, 0.0000)
            (0.0000, 1.0000, 0.0000, 0.0000)
            (0.0000, 0.0000, 1.0000, 0.0000)
            (0.0000, 0.0000, 0.0000, 1.0000)&gt;


However accessing the matrix from the python console, bpy.context.object.matrix_world, shows the correct world matrix with the translation (the last column):

Matrix(((1.0, 0.0, 0.0, 1.0),
        (0.0, 1.0, 0.0, 2.0),
        (0.0, 0.0, 1.0, 3.0),
        (0.0, 0.0, 0.0, 1.0)))


Therefore, what is the correct way to access the modified matrix values after changing an object's 
location, rotation, or scale?
Note for those using blender 2.8x: scene.update() has been removed as of 2.80. Use bpy.context.view_layer.update() instead, as per this post.