From: cpp.matlab on
I have a c program that sends signals via UDP to UDP receive block in
a Simulink model.
UDP receive in simulink is in blocking mode because in the non
blocking mode signal is very noisy.

As per requirements, I have to stop c program first.
That causes UDP receive in SIMULINK to time out and pops an error
"data not received in time".
Is there a better way to stop simulink.

If i stop simulink model first this wont happen, but i have to stop c
program first.

Any help is appreciated
Thanks!