This Matlab code is only directly used and discussed in detail in Section 1 of the supplementary note, which in turn supports a claim made towards the end of Section 3.1 in the paper. The issue is the optimality of money burning in a version of the model with three types. As discussed in the supplementary note, the Matlab code solves the model with three types and produces a figure with the optimal allocation. The optimal allocation is shown as a function of the middle type's probability for regions where money burning is optimal. In particular, Figure 1 in the supplement was produced by this code, and illustrates a case where money burning is optimal for intermediate values of the middle type's probability.