In Matlab Simulink model You have to insert PowerGui in your model. In PowerGui there is an option called FFT Analysis. click there and you will be able to harmonic analyze, Amount of Total Harmonics Distortion...etc.
Your mentioned switching loss calculation method is not clear to me. Could you please elaborate the full procedure to calculate the switching loss in Multi-level Inverter?