Is there any way to stop a script launched with 'run' or 'source' from Matlab / GNU Octave? I mean different from Ctrl-C, say that a given condition (perhaps given by global variables) holds and a break signal is sent to it.
Example:
The script haltable.m
is to be stopped when the environment
variable takes a value higher than 0.5.
global environment
while (true)
environment = rand;
endwhile
It is launched with
global environment
run ('haltable.m')
Where (outside of haltable.m
, of course) could it be specified that it must halt after the condition is met?