Below several pieces of code are provided under the GPL v3.0 license.
SpinTool
A set of MATLAB libraries and functions for simulating the Bloch equations. There is extensive documentation with examples; consult the MATLAB Cheat Sheet PDF file in the main directory.
[Library will be uploaded soon; meanwhile, email me directly for the files]