Matlab codes for Systemic Risk Project