MATLAB Hilfe-Center
Cancel job or task
cancel(t)
cancel(j)
cancel(t) stops the task object, t, that is currently in the pending or running state. The task's State property is set to 'finished', and no output arguments are returned. An error message stating that the task was canceled is placed in the task object's ErrorMessage property, and the worker session running the task is restarted.
t
State
'finished'
ErrorMessage
example
cancel(j) stops the job object, j, that is pending, queued, or running. The job's State property is set to 'finished', and a cancel is executed on all tasks in the job that are not in the 'finished' state. A job object that has been canceled cannot be started again.
j
If the job is running from a MATLAB® Job Scheduler, any worker sessions that are evaluating tasks belonging to the job object are restarted.
If the specified job or task is already in the 'finished' state, no action is taken.
collapse all
Cancel a task. Note afterward the task's State and Error properties.
Error
c = parcluster(); job1 = createJob(c); t = createTask(job1, @rand, 1, {3,3}); cancel(t) t
Task with properties: ID: 1 State: finished Function: @rand Parent: Job 1 StartDateTime: RunningDuration: 0 days 0h 0m 0s Error: The task was cancelled by user "mylogin" on machine "myhost.mydomain.com". Warnings: none
parallel.Task
Task, specified as a parallel.Task object.
parallel.Job
Job, specified as a parallel.Job object.
Introduced before R2006a
cancelAll | delete | submit
cancelAll
delete
submit
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
Europa
Asien-Pazifik
Kontakt zu Ihrer lokalen Niederlassung