Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cancel

Stop function running in the background.

Syntax

  • cancel(f)

Input argument

  • f - FevalFuture object: scalar or array.

Description

cancel(f) will stop each running or queued element of the Future array f.

Future cancelled Findicates an error as property.

Some functions cannot be interrupted by pressing Ctrl+C or cancel, such as save function.

Example

fptr = str2func('pause');
for i = 1:100
 f(i) = parfeval(backgroundPool, fptr, 0, 5);
end
f(70)
cancel(f(70))
f(70)

See also

pause, parfeval, wait.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET