"Christian" wrote in message <kd5jj2$87p$1@newscl01ah.mathworks.com>...
> > For that, I would have a dialog with a "Stop" button and have the code
> > periodically test if the button has been pressed. Have the code RETURN or
> > ERROR if the button has been pressed.
>
> That's exactly what I'm doing now. Since there is no single line of code executing periodically it's a bit of a mess.
Not justified as argument. Why not check at the same time where the graph/displayed is updated? That's the place where the user can see something new happens and decides to stop or pursue the process.
Just centralize the plotting in one customized function then check the button state inside.
Bruno
> > For that, I would have a dialog with a "Stop" button and have the code
> > periodically test if the button has been pressed. Have the code RETURN or
> > ERROR if the button has been pressed.
>
> That's exactly what I'm doing now. Since there is no single line of code executing periodically it's a bit of a mess.
Not justified as argument. Why not check at the same time where the graph/displayed is updated? That's the place where the user can see something new happens and decides to stop or pursue the process.
Just centralize the plotting in one customized function then check the button state inside.
Bruno