Simple Matlab code to calculate both the translational displacement and angular displacement of a TMS coil relative to a specified instrument marker created in Localite TMS navigator software.