I get this message in the window when the issue happens,
Error while evaluating DestroyedObject PrivatePushedButtonFcn
This is supposed to indicate an infinite loop I think, but I do not have an infinite loop, it just takes a long time sometimes. I have a for loop with 5 further for loops inside it to iterate over my simulink tests the way I want. I think Matlab has erroneously detected an infinite loop. How do I get over this/ switch off that check?