Matlab code for TLSA