May I know why especially are you using MATLAB? There are many things that you have to build from scratch. You may try for NS2/NS3 or Omnet++ depending on the network architecture you are focusing.
yes, i simulate MAC protocols for a my designed wsn using NS-2
but now i want to modify or improve this wsn by using deep learning, and NS-2 is not suitable and i have not NetSim, also i do not know if Omnet is suitable to compile with matlab or not and how if it possible.
on file exchange i found an answer for a question that matlab 2017 is able to simulate ieee802.15.4 (many layers)