First it will be possible to write the program in C to introduce the fault or a line outage and make the link with Matlab, because this is possible because C and C ++ are compatible with Matlab.
Second you can use MATPOWER is an open source programming package of Matlab, this package is dedicated to simulate power lines.
For more details and information about this subject, I suggest you to see links and attached files on topic.