Assuming you can write simple MATLAB code snippets, it is quite similar to solving a system of differential equations in MATLAB.
Create a script in which you describe dynamics and the control law. Make it a MATLAB function (dynamics). Create another script from which you can call this function and make analysis in this script such as plots, data analysis, etc.
Please refer the following book if you are new to MATLAB and SMC: