MATLAB: Do I receive the message “Simulink internal memory corruption detected!” when I run the Simulink model

simulink

When I run my model, I receive the following error:
Simulink internal memory corruption detected!

Best Answer

It looks like you are seeing the results of the following simulation setting:
Diagnostics -> Data Validty -> Debugging -> Array bounds exceeded
Note that the use of this setting can slow your simulation down significantly. However, it is very useful for debugging S-functions